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: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
This commit is contained in:
Родитель
d1abaeb3be
Коммит
635714312e
|
@ -830,7 +830,7 @@ static void parse_grep(const char *str)
|
||||||
cp++;
|
cp++;
|
||||||
while (isspace(*cp))
|
while (isspace(*cp))
|
||||||
cp++;
|
cp++;
|
||||||
if (strncmp(cp, "grep ", 5)) {
|
if (!str_has_prefix(cp, "grep ")) {
|
||||||
kdb_printf("invalid 'pipe', see grephelp\n");
|
kdb_printf("invalid 'pipe', see grephelp\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче