Skip to contentSkip to conversation

lib/cmdline: remove an unneeded local variable in next_arg()

PATCH Applied Masahiro Yamada 1 participant 1 message Feb 1, 2021 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/cmdline: remove an unneeded local variable in next_arg()

The local variable 'next' is unneeded because you can simply advance the existing pointer 'args'.

---

 lib/cmdline.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
lib/cmdline.c +3 -4
index b390dd03363b..f9844ea417c0 100644
@@ -215,7 +215,6 @@ char *next_arg(char *args, char **param, char **val)
 {
 	unsigned int i, equals = 0;
 	int in_quote = 0, quoted = 0;
-	char *next;
 
 	if (*args == '"') {
 		args++;
@@ -253,10 +252,10 @@ char *next_arg(char *args, char **param, char **val)
 
 	if (args[i]) {
 		args[i] = '\0';
-		next = args + i + 1;
+		args += i + 1;
 	} else
-		next = args + i;
+		args += i;
 
 	/* Chew up trailing spaces. */
-	return skip_spaces(next);
+	return skip_spaces(args);
 }
Signature · 1 line
2.27.0