From: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx> No need to traverse the whole string. Using `!strlen(str)` as a conditional expression is effectively the same with `!str[0]`. Signed-off-by: Ammar Faizi <ammarfaizi2@xxxxxxxxxxx> --- json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json.c b/json.c index cd3d5d74..8b650721 100644 --- a/json.c +++ b/json.c @@ -56,7 +56,7 @@ static char *strdup_escape(const char *str) char *p, *ret; int escapes; - if (!strlen(str)) + if (!str[0]) return NULL; escapes = 0; -- Ammar Faizi