version 1.13, 2002/05/09 19:19:33 |
version 1.14, 2003/04/05 20:31:58 |
|
|
static char buf[16384]; |
static char buf[16384]; |
int count = 0, len = 0; |
int count = 0, len = 0; |
|
|
(void) sprintf(buf, "("); |
(void) snprintf(buf, sizeof buf, "("); |
|
|
while (nl != NULL) { |
while (nl != NULL) { |
if (nl->n_name == NULL) |
if (nl->n_name == NULL) |
continue; |
continue; |
len += strlen(nl->n_name) + 2; |
len += strlen(nl->n_name) + 2; |
if (len >= sizeof(buf)) { |
if (len >= sizeof(buf)) { |
(void) strcpy(buf, |
(void) strlcpy(buf, |
"getnlstr() Buffer not large enough"); |
"getnlstr() Buffer not large enough", |
|
sizeof buf); |
return(buf); |
return(buf); |
} |
} |
++count; |
++count; |
(void) strcat(buf, " "); |
(void) strlcat(buf, " ", sizeof buf); |
(void) strcat(buf, nl->n_name); |
(void) strlcat(buf, nl->n_name, sizeof buf); |
nl = nl->n_next; |
nl = nl->n_next; |
} |
} |
|
|
(void) strcat(buf, " )"); |
(void) strlcat(buf, " )", sizeof buf); |
|
|
return(buf); |
return(buf); |
} |
} |