# HG changeset patch # User Mychaela Falconia # Date 1534013994 0 # Node ID ed9b67e7e741405339d24a753b9bf9413790d18c # Parent c0716b2ddfce016000afc2fff5fac9434330c9ac fcup-smsend: fixed bug in the handling of -W with no dest address argument The original code checked for argv[optind+1] when argv[optind] is NULL; on most systems this bogus code gets the first line of the environment, which is clearly not what we are after. Fixed the code to check argc instead. diff -r c0716b2ddfce -r ed9b67e7e741 uptools/atcmd/smsend_main.c --- a/uptools/atcmd/smsend_main.c Sun Mar 18 18:40:41 2018 +0000 +++ b/uptools/atcmd/smsend_main.c Sat Aug 11 18:59:54 2018 +0000 @@ -92,7 +92,7 @@ "error: destination address argument is invalid\n"); exit(ERROR_USAGE); } - if (!argv[optind+1]) + if (argc < optind + 2) return(0); if (strlen(argv[optind+1]) > MAX_MSG_CHARS*2) { fprintf(stderr, "error: message argument is too long\n");