--- embedaddon/mpd/src/modem.c 2013/07/22 08:44:29 1.1.1.1 +++ embedaddon/mpd/src/modem.c 2021/03/17 00:39:23 1.1.1.2 @@ -116,7 +116,7 @@ static void ModemChatIdleResult(void *arg, int rslt, const char *msg); - static int ModemSetCommand(Context ctx, int ac, char *av[], void *arg); + static int ModemSetCommand(Context ctx, int ac, const char *const av[], const void *arg); static int ModemInstallNodes(Link l); static int ModemGetNgStats(Link l, struct ng_async_stat *sp); @@ -161,7 +161,7 @@ ModemSetCommand, NULL, 2, (void *) SET_SCRIPT_VAR }, { "watch [+|-cd] [+|-dsr]", "Set signals to monitor", ModemSetCommand, NULL, 2, (void *) SET_WATCH }, - { NULL }, + { NULL, NULL, NULL, NULL, 0, NULL }, }; /* @@ -792,7 +792,7 @@ ModemGetNgStats(Link l, struct ng_async_stat *sp) */ static int -ModemSetCommand(Context ctx, int ac, char *av[], void *arg) +ModemSetCommand(Context ctx, int ac, const char *const av[], const void *arg) { Link const l = ctx->lnk; ModemInfo const m = (ModemInfo) l->info; @@ -847,25 +847,27 @@ ModemSetCommand(Context ctx, int ac, char *av[], void case SET_WATCH: { int bit, add; + const char *s; while (ac--) { - switch (**av) { + s = *av; + switch (*s) { case '+': - (*av)++; + s++; default: add = TRUE; break; case '-': add = FALSE; - (*av)++; + s++; break; } - if (!strcasecmp(*av, "cd")) + if (!strcasecmp(s, "cd")) bit = TIOCM_CAR; - else if (!strcasecmp(*av, "dsr")) + else if (!strcasecmp(s, "dsr")) bit = TIOCM_DSR; else { - Printf("[%s] modem signal \"%s\" is unknown\r\n", l->name, *av); + Printf("[%s] modem signal \"%s\" is unknown\r\n", l->name, s); bit = 0; } if (add) @@ -901,6 +903,7 @@ ModemOriginated(Link l) static int ModemIsSync(Link l) { + (void)l; return (0); }