summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thorarensen <sebth@naju.se>2014-07-06 20:31:58 +0200
committerSebastian Thorarensen <sebth@naju.se>2014-07-06 23:24:10 +0200
commit1c73bde23961a3526c4f48e490c3a502f1e429ce (patch)
tree3c20333f9c00cd72e4dae0695f6c2708dc6f6922
parent695a6a7d9bf8ffbe9378c6aff7c69aa259f2c8c7 (diff)
downloadirssi-1c73bde23961a3526c4f48e490c3a502f1e429ce.zip
Fix minor coding style issues in message splitting
-rw-r--r--src/core/misc.c5
-rw-r--r--src/core/recode.c5
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,