From 6388d368586ef303787d31d7728ce7a4e770f496 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 11 Feb 2025 21:38:24 +0100 Subject: [PATCH] core: remove unnecessary null check --- src/core/core-string.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/core-string.c b/src/core/core-string.c index be4d3d17e..62d53a97e 100644 --- a/src/core/core-string.c +++ b/src/core/core-string.c @@ -2966,8 +2966,8 @@ string_split_command (const char *command, char separator) str_idx = -1; p = buffer; /* strip white spaces at the beginning of the line */ - while (*p == ' ') p++; - if (p && p[0]) + while (p[0] == ' ') p++; + if (p[0]) array[arr_idx++] = strdup (p); } else if (type == 2) @@ -2980,8 +2980,8 @@ string_split_command (const char *command, char separator) buffer[str_idx] = '\0'; p = buffer; - while (*p == ' ') p++; - if (p && p[0]) + while (p[0] == ' ') p++; + if (p[0]) array[arr_idx++] = strdup (p); array[arr_idx] = NULL;