write_common: Remove check which is never true.
authorAndre Noll <maan@systemlinux.org>
Thu, 4 Nov 2010 08:12:57 +0000 (09:12 +0100)
committerAndre Noll <maan@systemlinux.org>
Tue, 23 Nov 2010 16:33:46 +0000 (17:33 +0100)
All writers have a config parser. This check was bogus anyway: If there was a writer
without config parser and we call it without arguments (i.e. "c" is NULL), this would lead
to a NULL pointer dereference.

write_common.c

index 5352356..fb7f477 100644 (file)
@@ -66,8 +66,6 @@ void *check_writer_arg(const char *wa, int *writer_num)
                c = wa[len];
                if (c && c != ' ')
                        continue;
-               if (c && !writers[i].parse_config_or_die)
-                       return NULL;
                *writer_num = i;
                return writers[i].parse_config_or_die(c? wa + len + 1 : "");
        }