From 314922e8bb720d917e44906600a29ef6185b74ac Mon Sep 17 00:00:00 2001 From: Xuguo Wang Date: Tue, 31 May 2016 11:44:16 +0800 Subject: [PATCH] inmates/lib: cmdline.c There is no point in checking for *p == 0 in the while loop, after over the blanks, then checking for the parameters, if find, return true, otherwise continue check the parameters, if to the end of the cmdline, return false. Signed-off-by: Xuguo Wang [Jan: also removed curly braces] Signed-off-by: Jan Kiszka --- inmates/lib/cmdline.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/inmates/lib/cmdline.c b/inmates/lib/cmdline.c index f27c797..bcbedb0 100644 --- a/inmates/lib/cmdline.c +++ b/inmates/lib/cmdline.c @@ -22,11 +22,8 @@ static bool get_param(const char *param, char *value_buffer, while (1) { /* read over leading blanks */ - while (*p == ' ') { - if (*p == 0) - return false; + while (*p == ' ') p++; - } if (strncmp(p, param, param_len) == 0) { p += param_len; -- 2.39.2