From: Dmitry V. Levin Date: Wed, 30 Nov 2016 16:50:56 +0000 (+0000) Subject: syscall: Simplify strip_prefix X-Git-Tag: v4.15~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ec8f7833562b397befbc9349edf95e9eb53b633d;p=strace syscall: Simplify strip_prefix * syscall.c (strip_prefix): Use strncmp instead of strlen+memcmp. --- diff --git a/syscall.c b/syscall.c index 602465db..0488234e 100644 --- a/syscall.c +++ b/syscall.c @@ -581,8 +581,7 @@ strip_prefix(const char *prefix, const char *str) { size_t len = strlen(prefix); - return (len > strlen(str) || memcmp(prefix, str, len)) - ? NULL : str + len; + return strncmp(prefix, str, len) ? NULL : str + len; } static int