aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/librc/librc-misc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/librc/librc-misc.c b/src/librc/librc-misc.c
index fe6d21ef..73662ecc 100644
--- a/src/librc/librc-misc.c
+++ b/src/librc/librc-misc.c
@@ -203,14 +203,18 @@ rc_config_value(RC_STRINGLIST *list, const char *entry)
{
RC_STRING *line;
char *p;
+ size_t len, dif;
+ len = strlen(entry);
TAILQ_FOREACH(line, list, entries) {
p = strchr(line->value, '=');
- if (p &&
- strncmp(entry, line->value, (size_t)(p - line->value)) == 0)
- return p += 1;
+ if (p != NULL) {
+ dif = (p - line->value);
+ if (dif == len &&
+ strncmp(entry, line->value, dif) == 0)
+ return ++p;
+ }
}
-
return NULL;
}
librc_hidden_def(rc_config_value)