Fix crash bug in log_custom (Patch by Korbinian Rosenegger)
authorjelmer@VERNSTOK.NL <jelmer@VERNSTOK.NL>
Fri, 4 Feb 2005 00:30:02 +0000 (02:30 +0200)
committerjelmer@VERNSTOK.NL <jelmer@VERNSTOK.NL>
Fri, 4 Feb 2005 00:30:02 +0000 (02:30 +0200)
mods/log_custom.c

index 35fb667d44e3287a6751a9f74951ffe57dfaf255..4f749a982640dd29f5b978d72ba39df6f8b6be89 100644 (file)
@@ -209,6 +209,7 @@ static void custom_subst(char **_new, const char *fmt, struct line *l, const cha
        for(i = 0; i < strlen(fmt); i++) {
                if(fmt[i] == '%') {
                        subst[(int)fmt[i+1]] = find_mapping(l, fmt[i+1], case_sensitive);       
+                       if (subst[(int)fmt[i+1]] == NULL) subst[(int)fmt[i+1]] = g_strdup("");
                        len += strlen(subst[(int)fmt[i+1]]);
                }
        }