Commit 63571431 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Daniel Thompson

kdb: Replace strncmp with str_has_prefix

strncmp(str, const, len) is error-prone.
We had better use newly introduced
str_has_prefix() instead of it.
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Signed-off-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
parent d1abaeb3
......@@ -830,7 +830,7 @@ static void parse_grep(const char *str)
cp++;
while (isspace(*cp))
cp++;
if (strncmp(cp, "grep ", 5)) {
if (!str_has_prefix(cp, "grep ")) {
kdb_printf("invalid 'pipe', see grephelp\n");
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment