summaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/json.c b/src/json.c
index e2a4424463b..23234c767d8 100644
--- a/src/json.c
+++ b/src/json.c
@@ -197,9 +197,7 @@ init_json (void)
static bool
json_has_prefix (const char *string, const char *prefix)
{
- size_t string_len = strlen (string);
- size_t prefix_len = strlen (prefix);
- return string_len >= prefix_len && memcmp (string, prefix, prefix_len) == 0;
+ return strncmp (string, prefix, strlen (prefix)) == 0;
}
/* Return whether STRING ends with SUFFIX. */