FreeCalypso > hg > freecalypso-tools
comparison rvinterf/asyncshell/sendarb.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 |
comparison
equal
deleted
inserted
replaced
63:09b4fd9b3827 | 64:d43d82cbfb85 |
---|---|
7 #include <ctype.h> | 7 #include <ctype.h> |
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 "limits.h" | 11 #include "limits.h" |
12 #include "exitcodes.h" | |
12 | 13 |
13 cmd_send_common(argc, argv) | 14 cmd_send_common(argc, argv) |
14 char **argv; | 15 char **argv; |
15 { | 16 { |
16 u_char sendpkt[MAX_PKT_TO_TARGET]; | 17 u_char sendpkt[MAX_PKT_TO_TARGET]; |
20 for (i = 0; i < pktlen; i++) { | 21 for (i = 0; i < pktlen; i++) { |
21 sendpkt[i] = strtoul(argv[i], &endp, 16); | 22 sendpkt[i] = strtoul(argv[i], &endp, 16); |
22 if (*endp) { | 23 if (*endp) { |
23 printf( | 24 printf( |
24 "error: all arguments to send command must be hex bytes\n"); | 25 "error: all arguments to send command must be hex bytes\n"); |
25 return(1); | 26 return(ERROR_USAGE); |
26 } | 27 } |
27 } | 28 } |
28 /* send it! */ | 29 /* send it! */ |
29 send_pkt_to_target(sendpkt, pktlen); | 30 send_pkt_to_target(sendpkt, pktlen); |
30 return(0); | 31 return(0); |