projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d1abaeb
)
kdb: Replace strncmp with str_has_prefix
author
Chuhong Yuan
<hslester96@gmail.com>
Mon, 29 Jul 2019 15:13:59 +0000
(23:13 +0800)
committer
Daniel Thompson
<daniel.thompson@linaro.org>
Tue, 3 Sep 2019 10:19:31 +0000
(11:19 +0100)
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>
kernel/debug/kdb/kdb_main.c
patch
|
blob
|
blame
|
history
diff --git
a/kernel/debug/kdb/kdb_main.c
b/kernel/debug/kdb/kdb_main.c
index 9ecfa37c7fbfc2ba52d79c62d8e1991b0d28538a..4567fe998c306730c76c0b3be245f6dba145d3a6 100644
(file)
--- a/
kernel/debug/kdb/kdb_main.c
+++ b/
kernel/debug/kdb/kdb_main.c
@@
-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;
}