FreeCalypso > hg > freecalypso-tools
comparison uptools/atcmd/smdump.c @ 467:dc2fd8e6f42c
uptools/atcmd: null pointer passing fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 11 Feb 2019 22:17:46 +0000 |
parents | b88a37d4f148 |
children | da724c67159d |
comparison
equal
deleted
inserted
replaced
466:5bcf12be0834 | 467:dc2fd8e6f42c |
---|---|
110 | 110 |
111 emit_pb_name() | 111 emit_pb_name() |
112 { | 112 { |
113 u_char decoded_name[81]; | 113 u_char decoded_name[81]; |
114 | 114 |
115 gsm7_to_ascii_or_ext(pbname_gsm, pbname_len, decoded_name, 0, 0, 0, 0); | 115 gsm7_to_ascii_or_ext(pbname_gsm, pbname_len, decoded_name, |
116 (unsigned *) 0, 0, 0, (unsigned *) 0); | |
116 printf("Phonebook-Name: %s\n", decoded_name); | 117 printf("Phonebook-Name: %s\n", decoded_name); |
117 } | 118 } |
118 | 119 |
119 cmgl_pdu() | 120 cmgl_pdu() |
120 { | 121 { |
152 struct delafter *rec; | 153 struct delafter *rec; |
153 char cmgd_cmd[32]; | 154 char cmgd_cmd[32]; |
154 | 155 |
155 for (rec = delafter_head; rec; rec = rec->next) { | 156 for (rec = delafter_head; rec; rec = rec->next) { |
156 sprintf(cmgd_cmd, "AT+CMGD=%u", rec->msgid); | 157 sprintf(cmgd_cmd, "AT+CMGD=%u", rec->msgid); |
157 atinterf_exec_cmd_needok(cmgd_cmd, 0, 0); | 158 atinterf_exec_cmd_needok(cmgd_cmd, (char *) 0, (void *) 0); |
158 } | 159 } |
159 } | 160 } |
160 | 161 |
161 main(argc, argv) | 162 main(argc, argv) |
162 char **argv; | 163 char **argv; |
178 fprintf(stderr, "usage: %s [options]\n", argv[0]); | 179 fprintf(stderr, "usage: %s [options]\n", argv[0]); |
179 exit(ERROR_USAGE); | 180 exit(ERROR_USAGE); |
180 } | 181 } |
181 atinterf_init(); | 182 atinterf_init(); |
182 /* enable verbose error messages */ | 183 /* enable verbose error messages */ |
183 atinterf_exec_cmd_needok("AT+CMEE=2", 0, 0); | 184 atinterf_exec_cmd_needok("AT+CMEE=2", (char *) 0, (void *) 0); |
184 /* put the 07.05 modem in PDU mode */ | 185 /* put the 07.05 modem in PDU mode */ |
185 atinterf_exec_cmd_needok("AT+CMGF=0", 0, 0); | 186 atinterf_exec_cmd_needok("AT+CMGF=0", (char *) 0, (void *) 0); |
186 /* HEX charset for phonebook names */ | 187 /* HEX charset for phonebook names */ |
187 atinterf_exec_cmd_needok("AT+CSCS=\"HEX\"", 0, 0); | 188 atinterf_exec_cmd_needok("AT+CSCS=\"HEX\"", (char *) 0, (void *) 0); |
188 /* main command */ | 189 /* main command */ |
189 atinterf_exec_cmd_needok("AT+CMGL=4", 0, cmgl_callback); | 190 atinterf_exec_cmd_needok("AT+CMGL=4", (char *) 0, cmgl_callback); |
190 if (pdu_state) { | 191 if (pdu_state) { |
191 fprintf(stderr, "error: wrong state at the end of +CMGL\n"); | 192 fprintf(stderr, "error: wrong state at the end of +CMGL\n"); |
192 exit(ERROR_TARGET); | 193 exit(ERROR_TARGET); |
193 } | 194 } |
194 if (delete_after_flag) | 195 if (delete_after_flag) |
195 delete_after_process(); | 196 delete_after_process(); |
196 /* be nice and restore IRA charset for manual AT command users */ | 197 /* be nice and restore IRA charset for manual AT command users */ |
197 atinterf_exec_cmd_needok("AT+CSCS=\"IRA\"", 0, 0); | 198 atinterf_exec_cmd_needok("AT+CSCS=\"IRA\"", (char *) 0, (void *) 0); |
198 exit(0); | 199 exit(0); |
199 } | 200 } |