[OpenWrt-Devel] [PATCH] uqmi_add_command: fixed command argument assignment

Carlo Lobrano c.lobrano at gmail.com
Thu Jun 22 03:40:37 EDT 2017


The char *arg passed to uqmi_add_command was not assigned to cmd[idx].arg.

---

Hi,

I saw this little bug. Hope this is the right place to submit the patch

Best regards,
Carlo

---

 commands.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands.c b/commands.c
index f9545a9..8e9810d 100644
--- a/commands.c
+++ b/commands.c
@@ -193,7 +193,7 @@ void uqmi_add_command(char *arg, int cmd)
 
 	cmds = realloc(cmds, n_cmds * sizeof(*cmds));
 	cmds[idx].handler = &uqmi_cmd_handler[cmd];
-	cmds[idx].arg = optarg;
+	cmds[idx].arg = arg;
 }
 
 static void uqmi_print_result(struct blob_attr *data)
-- 
2.9.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list