diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-07 08:06:23 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-07 08:06:23 +0100 |
commit | 23ab4cf76ef156db35dfaae704966fd0963c12d6 (patch) | |
tree | 8d817f103adb8a91da5e365637bd28cedd78c07d /src/main.c | |
parent | fcee885c320b0056058a501eca192e56c453df8a (diff) | |
download | rspamd-23ab4cf76ef156db35dfaae704966fd0963c12d6.tar.gz rspamd-23ab4cf76ef156db35dfaae704966fd0963c12d6.zip |
Slightly improve variables extraction code.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c index b6649234f..dfd6182d8 100644 --- a/src/main.c +++ b/src/main.c @@ -1075,13 +1075,13 @@ main (gint argc, gchar **argv, gchar **env) if (argc > 0) { /* Parse variables */ for (i = 0; i < argc; i ++) { - /* XXX: inefficient, but executed merely once */ if (strchr (argv[i], '=') != NULL) { - gchar *k, *v; + gchar *k, *v, *t; k = g_strdup (argv[i]); - v = g_strdup (strchr (k, '=') + 1); - *(strchr (k, '=')) = '\0'; + t = strchr (k, '='); + v = g_strdup (t + 1); + *t = '\0'; if (vars == NULL) { vars = g_hash_table_new_full (rspamd_strcase_hash, |