FreeCalypso > hg > freecalypso-tools
comparison rvinterf/asyncshell/at.c @ 64:d43d82cbfb85
fc-shell: use the newly adopted exit code convention
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 26 Oct 2016 22:25:18 +0000 |
parents | e7502631a0f9 |
children | bbc41034f14c |
comparison
equal
deleted
inserted
replaced
63:09b4fd9b3827 | 64:d43d82cbfb85 |
---|---|
8 #include <string.h> | 8 #include <string.h> |
9 #include <strings.h> | 9 #include <strings.h> |
10 #include <stdlib.h> | 10 #include <stdlib.h> |
11 #include "pktmux.h" | 11 #include "pktmux.h" |
12 #include "limits.h" | 12 #include "limits.h" |
13 #include "exitcodes.h" | |
13 | 14 |
14 send_string_to_ati(str) | 15 send_string_to_ati(str) |
15 char *str; | 16 char *str; |
16 { | 17 { |
17 unsigned len; | 18 unsigned len; |
18 u_char sendpkt[MAX_PKT_TO_TARGET+1]; | 19 u_char sendpkt[MAX_PKT_TO_TARGET+1]; |
19 | 20 |
20 len = strlen(str); | 21 len = strlen(str); |
21 if (len + 1 > MAX_PKT_TO_TARGET) { | 22 if (len + 1 > MAX_PKT_TO_TARGET) { |
22 printf("error: max pkt to target limit exceeded\n"); | 23 printf("error: max pkt to target limit exceeded\n"); |
23 return(1); | 24 return(ERROR_USAGE); |
24 } | 25 } |
25 /* fill out the packet */ | 26 /* fill out the packet */ |
26 sendpkt[0] = RVT_AT_HEADER; | 27 sendpkt[0] = RVT_AT_HEADER; |
27 strcpy(sendpkt + 1, str); | 28 strcpy(sendpkt + 1, str); |
28 /* send it! */ | 29 /* send it! */ |