changeset 467:dc2fd8e6f42c

uptools/atcmd: null pointer passing fixes
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 11 Feb 2019 22:17:46 +0000
parents 5bcf12be0834
children 542c6d733772
files uptools/atcmd/atcmd.c uptools/atcmd/settime.c uptools/atcmd/smdump.c uptools/atcmd/smsend_cmgw.c uptools/atcmd/smsend_main.c uptools/atcmd/smsend_multmain.c uptools/atcmd/smsend_pduin.c uptools/atcmd/smsend_pduout.c uptools/atcmd/smsend_text.c uptools/atcmd/smwrite.c
diffstat 10 files changed, 30 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/uptools/atcmd/atcmd.c	Mon Feb 11 05:50:45 2019 +0000
+++ b/uptools/atcmd/atcmd.c	Mon Feb 11 22:17:46 2019 +0000
@@ -31,7 +31,7 @@
 		exit(ERROR_USAGE);
 	}
 	atinterf_init();
-	atinterf_exec_cmd(argv[optind], 0, int_callback);
+	atinterf_exec_cmd(argv[optind], (char *) 0, int_callback);
 	puts(at_response+1);
 	exit(0);
 }
--- a/uptools/atcmd/settime.c	Mon Feb 11 05:50:45 2019 +0000
+++ b/uptools/atcmd/settime.c	Mon Feb 11 22:17:46 2019 +0000
@@ -33,6 +33,6 @@
 	sprintf(command, "AT+CCLK=\"%02d/%02d/%02d,%02d:%02d:%02d%+03d\"",
 		tm->tm_year % 100, tm->tm_mon + 1, tm->tm_mday,
 		tm->tm_hour, tm->tm_min, tm->tm_sec, tm->tm_gmtoff / (15*60));
-	atinterf_exec_cmd_needok(command, 0, 0);
+	atinterf_exec_cmd_needok(command, (char *) 0, (void *) 0);
 	exit(0);
 }
--- a/uptools/atcmd/smdump.c	Mon Feb 11 05:50:45 2019 +0000
+++ b/uptools/atcmd/smdump.c	Mon Feb 11 22:17:46 2019 +0000
@@ -112,7 +112,8 @@
 {
 	u_char decoded_name[81];
 
-	gsm7_to_ascii_or_ext(pbname_gsm, pbname_len, decoded_name, 0, 0, 0, 0);
+	gsm7_to_ascii_or_ext(pbname_gsm, pbname_len, decoded_name,
+			     (unsigned *) 0, 0, 0, (unsigned *) 0);
 	printf("Phonebook-Name: %s\n", decoded_name);
 }
 
@@ -154,7 +155,7 @@
 
 	for (rec = delafter_head; rec; rec = rec->next) {
 		sprintf(cmgd_cmd, "AT+CMGD=%u", rec->msgid);
-		atinterf_exec_cmd_needok(cmgd_cmd, 0, 0);
+		atinterf_exec_cmd_needok(cmgd_cmd, (char *) 0, (void *) 0);
 	}
 }
 
@@ -180,13 +181,13 @@
 	}
 	atinterf_init();
 	/* enable verbose error messages */
-	atinterf_exec_cmd_needok("AT+CMEE=2", 0, 0);
+	atinterf_exec_cmd_needok("AT+CMEE=2", (char *) 0, (void *) 0);
 	/* put the 07.05 modem in PDU mode */
-	atinterf_exec_cmd_needok("AT+CMGF=0", 0, 0);
+	atinterf_exec_cmd_needok("AT+CMGF=0", (char *) 0, (void *) 0);
 	/* HEX charset for phonebook names */
-	atinterf_exec_cmd_needok("AT+CSCS=\"HEX\"", 0, 0);
+	atinterf_exec_cmd_needok("AT+CSCS=\"HEX\"", (char *) 0, (void *) 0);
 	/* main command */
-	atinterf_exec_cmd_needok("AT+CMGL=4", 0, cmgl_callback);
+	atinterf_exec_cmd_needok("AT+CMGL=4", (char *) 0, cmgl_callback);
 	if (pdu_state) {
 		fprintf(stderr, "error: wrong state at the end of +CMGL\n");
 		exit(ERROR_TARGET);
@@ -194,6 +195,6 @@
 	if (delete_after_flag)
 		delete_after_process();
 	/* be nice and restore IRA charset for manual AT command users */
-	atinterf_exec_cmd_needok("AT+CSCS=\"IRA\"", 0, 0);
+	atinterf_exec_cmd_needok("AT+CSCS=\"IRA\"", (char *) 0, (void *) 0);
 	exit(0);
 }
--- a/uptools/atcmd/smsend_cmgw.c	Mon Feb 11 05:50:45 2019 +0000
+++ b/uptools/atcmd/smsend_cmgw.c	Mon Feb 11 22:17:46 2019 +0000
@@ -74,11 +74,11 @@
 		exit(ERROR_TARGET);
 	}
 	if (sendafterwr_head->next)
-		atinterf_exec_cmd_needok("AT+CMMS=1", 0, 0);
+		atinterf_exec_cmd_needok("AT+CMMS=1", (char *) 0, (void *) 0);
 	for (rec = sendafterwr_head; rec; rec = rec->next) {
 		sprintf(cmss_cmd, "AT+CMSS=%u", rec->msgid);
-		atinterf_exec_cmd_needok(cmss_cmd, 0, 0);
+		atinterf_exec_cmd_needok(cmss_cmd, (char *) 0, (void *) 0);
 	}
 	if (sendafterwr_head->next)
-		atinterf_exec_cmd_needok("AT+CMMS=0", 0, 0);
+		atinterf_exec_cmd_needok("AT+CMMS=0", (char *) 0, (void *) 0);
 }
--- a/uptools/atcmd/smsend_main.c	Mon Feb 11 05:50:45 2019 +0000
+++ b/uptools/atcmd/smsend_main.c	Mon Feb 11 22:17:46 2019 +0000
@@ -142,7 +142,7 @@
 {
 	atinterf_init();
 	/* enable verbose error messages */
-	atinterf_exec_cmd_needok("AT+CMEE=2", 0, 0);
+	atinterf_exec_cmd_needok("AT+CMEE=2", (char *) 0, (void *) 0);
 }
 
 gsm7_mode_main()
@@ -207,7 +207,7 @@
 	common_init();
 	prep_for_pdu_mode();
 	if (sms_write_mode == 0)
-		atinterf_exec_cmd_needok("AT+CMMS=1", 0, 0);
+		atinterf_exec_cmd_needok("AT+CMMS=1", (char *) 0, (void *) 0);
 	pos = 0;
 	remain = msgtext_gsmlen;
 	for (n = 1; n <= nparts; n++) {
@@ -220,7 +220,7 @@
 		remain -= chunk;
 	}
 	if (sms_write_mode == 0)
-		atinterf_exec_cmd_needok("AT+CMMS=0", 0, 0);
+		atinterf_exec_cmd_needok("AT+CMMS=0", (char *) 0, (void *) 0);
 	if (sms_write_mode == 1)
 		sendafterwr_process();
 	if (!concat_quiet)
@@ -270,7 +270,7 @@
 	common_init();
 	prep_for_pdu_mode();
 	if (sms_write_mode == 0)
-		atinterf_exec_cmd_needok("AT+CMMS=1", 0, 0);
+		atinterf_exec_cmd_needok("AT+CMMS=1", (char *) 0, (void *) 0);
 	pos = 0;
 	remain = msgtext_unilen;
 	for (n = 1; n <= nparts; n++) {
@@ -283,7 +283,7 @@
 		remain -= chunk;
 	}
 	if (sms_write_mode == 0)
-		atinterf_exec_cmd_needok("AT+CMMS=0", 0, 0);
+		atinterf_exec_cmd_needok("AT+CMMS=0", (char *) 0, (void *) 0);
 	if (sms_write_mode == 1)
 		sendafterwr_process();
 	if (!concat_quiet)
--- a/uptools/atcmd/smsend_multmain.c	Mon Feb 11 05:50:45 2019 +0000
+++ b/uptools/atcmd/smsend_multmain.c	Mon Feb 11 22:17:46 2019 +0000
@@ -108,13 +108,13 @@
 		return(0);
 	atinterf_init();
 	/* enable verbose error messages */
-	atinterf_exec_cmd_needok("AT+CMEE=2", 0, 0);
+	atinterf_exec_cmd_needok("AT+CMEE=2", (char *) 0, (void *) 0);
 	if (text_mode)
 		prep_for_text_mode();
 	else
 		prep_for_pdu_mode();
 	if (sms_write_mode == 0)
-		atinterf_exec_cmd_needok("AT+CMMS=1", 0, 0);
+		atinterf_exec_cmd_needok("AT+CMMS=1", (char *) 0, (void *) 0);
 	initdone = 1;
 	return(1);
 }
@@ -192,7 +192,7 @@
 	if (!initdone)
 		exit(0);
 	if (sms_write_mode == 0)
-		atinterf_exec_cmd_needok("AT+CMMS=0", 0, 0);
+		atinterf_exec_cmd_needok("AT+CMMS=0", (char *) 0, (void *) 0);
 	if (sms_write_mode == 1)
 		sendafterwr_process();
 	exit(0);
--- a/uptools/atcmd/smsend_pduin.c	Mon Feb 11 05:50:45 2019 +0000
+++ b/uptools/atcmd/smsend_pduin.c	Mon Feb 11 22:17:46 2019 +0000
@@ -61,11 +61,11 @@
 		return(0);
 	atinterf_init();
 	/* enable verbose error messages */
-	atinterf_exec_cmd_needok("AT+CMEE=2", 0, 0);
+	atinterf_exec_cmd_needok("AT+CMEE=2", (char *) 0, (void *) 0);
 	/* set PDU mode */
 	prep_for_pdu_mode();
 	if (sms_write_mode == 0 && more_input()) {
-		atinterf_exec_cmd_needok("AT+CMMS=1", 0, 0);
+		atinterf_exec_cmd_needok("AT+CMMS=1", (char *) 0, (void *) 0);
 		cmms_done = 1;
 	}
 	initdone = 1;
@@ -109,7 +109,7 @@
 	if (!initdone)
 		exit(0);
 	if (cmms_done)
-		atinterf_exec_cmd_needok("AT+CMMS=0", 0, 0);
+		atinterf_exec_cmd_needok("AT+CMMS=0", (char *) 0, (void *) 0);
 	if (sms_write_mode == 1)
 		sendafterwr_process();
 	exit(0);
--- a/uptools/atcmd/smsend_pduout.c	Mon Feb 11 05:50:45 2019 +0000
+++ b/uptools/atcmd/smsend_pduout.c	Mon Feb 11 22:17:46 2019 +0000
@@ -10,7 +10,7 @@
 
 prep_for_pdu_mode()
 {
-	atinterf_exec_cmd_needok("AT+CMGF=0", 0, 0);
+	atinterf_exec_cmd_needok("AT+CMGF=0", (char *) 0, (void *) 0);
 }
 
 send_pdu_out(pduhex, pdulen)
--- a/uptools/atcmd/smsend_text.c	Mon Feb 11 05:50:45 2019 +0000
+++ b/uptools/atcmd/smsend_text.c	Mon Feb 11 22:17:46 2019 +0000
@@ -11,9 +11,9 @@
 
 prep_for_text_mode()
 {
-	atinterf_exec_cmd_needok("AT+CMGF=1", 0, 0);
-	atinterf_exec_cmd_needok("AT+CSCS=\"8859-1\"", 0, 0);
-	atinterf_exec_cmd_needok("AT+CSMP=1,,0,0", 0, 0);
+	atinterf_exec_cmd_needok("AT+CMGF=1", (char *) 0, (void *) 0);
+	atinterf_exec_cmd_needok("AT+CSCS=\"8859-1\"", (char *) 0, (void *) 0);
+	atinterf_exec_cmd_needok("AT+CSMP=1,,0,0", (char *) 0, (void *) 0);
 }
 
 send_in_text_mode(binda, textstr)
--- a/uptools/atcmd/smwrite.c	Mon Feb 11 05:50:45 2019 +0000
+++ b/uptools/atcmd/smwrite.c	Mon Feb 11 22:17:46 2019 +0000
@@ -130,9 +130,9 @@
 	process_cmdline(argc, argv);
 	atinterf_init();
 	/* enable verbose error messages */
-	atinterf_exec_cmd_needok("AT+CMEE=2", 0, 0);
+	atinterf_exec_cmd_needok("AT+CMEE=2", (char *) 0, (void *) 0);
 	/* set PDU mode */
-	atinterf_exec_cmd_needok("AT+CMGF=0", 0, 0);
+	atinterf_exec_cmd_needok("AT+CMGF=0", (char *) 0, (void *) 0);
 	/* process stdin */
 	while (process_record())
 		;