changeset 405:ed9b67e7e741

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.
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 11 Aug 2018 18:59:54 +0000
parents c0716b2ddfce
children b88a37d4f148
files uptools/atcmd/smsend_main.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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");