diff mbox series

[2/2] modprobe: remove unneeded variable str_start

Message ID 20220210021423.3388827-2-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/2] modprobe: fix the NULL-termination of new_argv | expand

Commit Message

Masahiro Yamada Feb. 10, 2022, 2:14 a.m. UTC
The variable 'str_start' is not useful here.

Replace it with 'str'.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 tools/modprobe.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/tools/modprobe.c b/tools/modprobe.c
index b6b2947..324fcfd 100644
--- a/tools/modprobe.c
+++ b/tools/modprobe.c
@@ -683,7 +683,7 @@  static int options_from_array(char **args, int nargs, char **output)
 static char **prepend_options_from_env(int *p_argc, char **orig_argv)
 {
 	const char *p, *env = getenv("MODPROBE_OPTIONS");
-	char **new_argv, *str_start, *str_end, *str, *s, *quote;
+	char **new_argv, *str_end, *str, *s, *quote;
 	int i, argc = *p_argc;
 	size_t envlen, space_count = 0;
 
@@ -701,10 +701,10 @@  static char **prepend_options_from_env(int *p_argc, char **orig_argv)
 		return NULL;
 
 	new_argv[0] = orig_argv[0];
-	str_start = str = (char *) (new_argv + argc + space_count + 3);
+	str = (char *) (new_argv + argc + space_count + 3);
 	memcpy(str, env, envlen + 1);
 
-	str_end = str_start + envlen;
+	str_end = str + envlen;
 
 	quote = NULL;
 	for (i = 1, s = str; *s != '\0'; s++) {