From 2c9499bf272e06a62902711c6c20621ef3f80e64 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 1 Mar 2012 23:15:38 +0100 Subject: Use strcmp() instead of strncmp() strncmp() isn't intended to be a secure strcmp() replacement, it is designed to be used if you want to compare the first n characters of two strings. Since we always compare character pointers with string literals, switch to using strcmp() everywhere. Signed-off-by: Lukas Fleischer --- src/config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index 6355781..acc1584 100644 --- a/src/config.c +++ b/src/config.c @@ -117,9 +117,9 @@ typedef int (*config_fn_walk_junk_cb_t) (const char *, void *); static int config_parse_bool (unsigned *dest, const char *val) { - if (strncmp (val, "yes", 4) == 0) + if (strcmp (val, "yes") == 0) *dest = 1; - else if (strncmp (val, "no", 3) == 0) + else if (strcmp (val, "no") == 0) *dest = 0; else return 0; -- cgit v1.2.3-54-g00ecf