]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
inmates/lib: cmdline.c
authorXuguo Wang <huddy1985@gmail.com>
Tue, 31 May 2016 03:44:16 +0000 (11:44 +0800)
committerJan Kiszka <jan.kiszka@siemens.com>
Tue, 31 May 2016 10:57:48 +0000 (12:57 +0200)
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 <huddy1985@gmail.com>
[Jan: also removed curly braces]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
inmates/lib/cmdline.c

index f27c7975cc37c7074ea99c73acdc869dbff46721..bcbedb02a54e68774ac17c530493420cc942186c 100644 (file)
@@ -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;