diff options
-rw-r--r-- | src/core/misc.c | 5 | ||||
-rw-r--r-- | src/core/recode.c | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/core/misc.c b/src/core/misc.c index 19789f64..32cfeb9b 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -970,10 +970,11 @@ char *ascii_strdown(char *str) char **strsplit_len(const char *str, int len) { char **ret; - int n = strlen(str) / len; + size_t total_len = strlen(str); + int n = total_len / len; int i; - if (strlen(str) % len) + if (total_len % len) n++; ret = g_new(char *, n + 1); diff --git a/src/core/recode.c b/src/core/recode.c index 2f126d6e..029d7ff1 100644 --- a/src/core/recode.c +++ b/src/core/recode.c @@ -198,15 +198,14 @@ char **recode_split(const SERVER_REC *server, const char *str, int n = 0; char **ret; - if (!str) - return NULL; + g_return_val_if_fail(str != NULL, NULL); if (settings_get_bool("recode")) { to = find_conversion(server, target); if (to == NULL) /* default outgoing charset if set */ to = settings_get_str("recode_out_default_charset"); - if (to && *to != '\0') { + if (to != NULL && *to != '\0') { if (settings_get_bool("recode_transliterate") && !is_translit(to)) to = translit_to = g_strconcat(to, |