diff uptools/atcmd/smsend_main.c @ 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 40b1498ec39d
children dc2fd8e6f42c
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");