[OpenWrt-Devel] uqmi_add_command: fixed command argument assignment

Submitted by Carlo Lobrano on June 22, 2017, 7:40 a.m.

Details

Message ID 20170622074037.14512-1-c.lobrano@gmail.com
State New
Headers show

Commit Message

Carlo Lobrano June 22, 2017, 7:40 a.m.
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(-)

Patch hide | download patch | download mbox

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)