version 1.35, 2000/12/24 00:29:00 |
version 1.36, 2001/06/26 23:43:59 |
|
|
gateport = strdup(argv[2]); |
gateport = strdup(argv[2]); |
#endif |
#endif |
} |
} |
strncpy(gsbuf, argv[1], sizeof(gsbuf) - 1); |
strlcpy(gsbuf, argv[1], sizeof(gsbuf)); |
gsbuf[sizeof(gsbuf) - 1] = '\0'; |
|
gateserver = gsbuf; |
gateserver = gsbuf; |
gatemode = 1; |
gatemode = 1; |
} |
} |
|
|
if (namep == NULL) |
if (namep == NULL) |
namep = shell; |
namep = shell; |
shellnam[0] = '-'; |
shellnam[0] = '-'; |
(void)strncpy(shellnam + 1, ++namep, sizeof(shellnam) - 2); |
(void)strlcpy(shellnam + 1, ++namep, sizeof(shellnam) - 1); |
shellnam[sizeof(shellnam) - 1] = '\0'; |
|
if (strcmp(namep, "sh") != 0) |
if (strcmp(namep, "sh") != 0) |
shellnam[0] = '+'; |
shellnam[0] = '+'; |
if (debug) { |
if (debug) { |
|
|
int i, len; |
int i, len; |
char buf[BUFSIZ]; /* must be >= sizeof(line) */ |
char buf[BUFSIZ]; /* must be >= sizeof(line) */ |
|
|
(void)strncpy(buf, initial, sizeof(buf) - 1); |
(void)strlcpy(buf, initial, sizeof(buf)); |
buf[sizeof(buf) - 1] = '\0'; |
|
if (argc > 1) { |
if (argc > 1) { |
for (i = 1, len = strlen(buf); i < argc && len < sizeof(buf)-1; i++) { |
for (i = 1, len = strlen(buf); i < argc && len < sizeof(buf)-1; i++) { |
|
|
|
|
break; |
break; |
|
|
/* Copy next argument, NUL terminate always */ |
/* Copy next argument, NUL terminate always */ |
strncpy(&buf[len], argv[i], sizeof(buf) - len - 1); |
strlcpy(&buf[len], argv[i], sizeof(buf) - len); |
buf[sizeof(buf) - 1] = '\0'; |
|
|
|
/* Update string length */ |
/* Update string length */ |
len = strlen(buf); |
len = strlen(buf); |
|
|
} |
} |
ntflag++; |
ntflag++; |
code = ntflag; |
code = ntflag; |
(void)strncpy(ntin, argv[1], sizeof(ntin) - 1); |
(void)strlcpy(ntin, argv[1], sizeof(ntin)); |
ntin[sizeof(ntin) - 1] = '\0'; |
|
if (argc == 2) { |
if (argc == 2) { |
ntout[0] = '\0'; |
ntout[0] = '\0'; |
return; |
return; |
} |
} |
(void)strncpy(ntout, argv[2], sizeof(ntout) - 1); |
(void)strlcpy(ntout, argv[2], sizeof(ntout)); |
ntout[sizeof(ntout) - 1] = '\0'; |
|
} |
} |
|
|
char * |
char * |
|
|
if (interactive) |
if (interactive) |
fputs( |
fputs( |
"Enter macro line by line, terminating it with a null line.\n", ttyout); |
"Enter macro line by line, terminating it with a null line.\n", ttyout); |
(void)strncpy(macros[macnum].mac_name, argv[1], |
(void)strlcpy(macros[macnum].mac_name, argv[1], |
sizeof(macros[macnum].mac_name) - 1); |
sizeof(macros[macnum].mac_name)); |
macros[macnum].mac_name[sizeof(macros[macnum].mac_name) - 1] = '\0'; |
|
if (macnum == 0) |
if (macnum == 0) |
macros[macnum].mac_start = macbuf; |
macros[macnum].mac_start = macbuf; |
else |
else |