Lines 1-5
Link Here
|
1 |
--- mdmdetect.c.orig Sun Feb 11 01:02:58 2001 |
1 |
--- mdmdetect.c.orig Sat Jan 26 22:38:32 2002 |
2 |
+++ mdmdetect.c Tue Jul 24 00:10:05 2001 |
2 |
+++ mdmdetect.c Sat Jan 26 22:44:35 2002 |
3 |
@@ -37,7 +37,16 @@ |
3 |
@@ -37,7 +37,16 @@ |
4 |
#include <sys/types.h> |
4 |
#include <sys/types.h> |
5 |
#include <sys/socket.h> |
5 |
#include <sys/socket.h> |
Lines 17-19
Link Here
|
17 |
#ifdef SVR4 |
17 |
#ifdef SVR4 |
18 |
#include <sys/mkdev.h> |
18 |
#include <sys/mkdev.h> |
19 |
#endif /* SVR4 */ |
19 |
#endif /* SVR4 */ |
|
|
20 |
@@ -71,6 +80,18 @@ |
21 |
exit (1); |
22 |
} |
23 |
|
24 |
+char *CtrlArg (arg) |
25 |
+char *arg; |
26 |
+{ |
27 |
+ static char ret[240]; |
28 |
+ |
29 |
+ if(strlcpy(ret, arg, 240) >= 240) { |
30 |
+ fprintf(stderr, "Argument trop long: %s\n", arg); |
31 |
+ exit (1); |
32 |
+ } |
33 |
+ return (ret); |
34 |
+} |
35 |
+ |
36 |
/* Sortie */ |
37 |
static void the_end (r) |
38 |
int r; |
39 |
@@ -228,23 +249,24 @@ |
40 |
|
41 |
progname = xtel_basename(av[0]); |
42 |
|
43 |
- if (ac < 2) |
44 |
+ if (ac < 2 || ac > 7) |
45 |
Usage (progname); |
46 |
|
47 |
/* Lecture de la ligne de commande */ |
48 |
while (--ac) { |
49 |
- if ((cp = *++av) == NULL) |
50 |
+ if ((cp = CtrlArg(*++av)) == NULL) { |
51 |
break; |
52 |
+ } |
53 |
if (*cp == '-' && *++cp) { |
54 |
switch(*cp) { |
55 |
case 'b' : |
56 |
- builder = *++av; break; |
57 |
+ builder = CtrlArg(*++av); break; |
58 |
|
59 |
case 'd' : |
60 |
++debug; break; |
61 |
|
62 |
case 'l' : |
63 |
- modem_list = *++av; break; |
64 |
+ modem_list = CtrlArg(*++av); break; |
65 |
|
66 |
case 'q' : |
67 |
query = 1; break; |