summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/check_utility_compat.c9
-rw-r--r--lib/libc/gen/confstr.c5
-rw-r--r--lib/libc/gen/fmtmsg.c22
-rw-r--r--lib/libc/gen/getgrent.c4
-rw-r--r--lib/libc/gen/getpwent.c10
5 files changed, 25 insertions, 25 deletions
diff --git a/lib/libc/gen/check_utility_compat.c b/lib/libc/gen/check_utility_compat.c
index 0ccdec1..2a0db43 100644
--- a/lib/libc/gen/check_utility_compat.c
+++ b/lib/libc/gen/check_utility_compat.c
@@ -30,15 +30,12 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-/*
- * I din't use "namespace.h" here because none of the relevant utilities
- * are threaded, so I'm not concerned about cancellation points or other
- * niceties.
- */
+#include "namespace.h"
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include "un-namespace.h"
#ifndef LINE_MAX
#define LINE_MAX _POSIX2_LINE_MAX
@@ -55,7 +52,7 @@ check_utility_compat(const char *utility)
int len;
if ((p = getenv(_ENV_UTIL_COMPAT)) != NULL) {
- strlcpy(buf, p, sizeof buf);
+ _strlcpy(buf, p, sizeof buf);
} else {
if ((len = readlink(_PATH_UTIL_COMPAT, buf, sizeof buf)) < 0)
return 0;
diff --git a/lib/libc/gen/confstr.c b/lib/libc/gen/confstr.c
index 966c3fe..2885afd 100644
--- a/lib/libc/gen/confstr.c
+++ b/lib/libc/gen/confstr.c
@@ -37,13 +37,14 @@ static char sccsid[] = "@(#)confstr.c 8.1 (Berkeley) 6/4/93";
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "namespace.h"
#include <sys/param.h>
-
#include <errno.h>
#include <limits.h>
#include <paths.h>
#include <string.h>
#include <unistd.h>
+#include "un-namespace.h"
size_t
@@ -114,7 +115,7 @@ confstr(int name, char *buf, size_t len)
docopy:
if (len != 0 && buf != NULL)
- strlcpy(buf, p, len);
+ _strlcpy(buf, p, len);
return (strlen(p) + 1);
default:
diff --git a/lib/libc/gen/fmtmsg.c b/lib/libc/gen/fmtmsg.c
index 6caabbb..a9b4e60 100644
--- a/lib/libc/gen/fmtmsg.c
+++ b/lib/libc/gen/fmtmsg.c
@@ -27,10 +27,12 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "namespace.h"
#include <fmtmsg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "un-namespace.h"
/* Default value for MSGVERB. */
#define DFLT_MSGVERB "label:severity:text:action:tag"
@@ -101,13 +103,13 @@ def:
#define INSERT_COLON \
if (*output != '\0') \
- strlcat(output, ": ", size)
+ _strlcat(output, ": ", size)
#define INSERT_NEWLINE \
if (*output != '\0') \
- strlcat(output, "\n", size)
+ _strlcat(output, "\n", size)
#define INSERT_SPACE \
if (*output != '\0') \
- strlcat(output, " ", size)
+ _strlcat(output, " ", size)
/*
* Returns NULL on memory allocation failure, otherwise returns a pointer to
@@ -139,20 +141,20 @@ printfmt(char *msgverb, long class, const char *label, int sev,
while ((comp = nextcomp(msgverb)) != NULL) {
if (strcmp(comp, "label") == 0 && label != MM_NULLLBL) {
INSERT_COLON;
- strlcat(output, label, size);
+ _strlcat(output, label, size);
} else if (strcmp(comp, "severity") == 0 && sevname != NULL) {
INSERT_COLON;
- strlcat(output, sevinfo(sev), size);
+ _strlcat(output, sevinfo(sev), size);
} else if (strcmp(comp, "text") == 0 && text != MM_NULLTXT) {
INSERT_COLON;
- strlcat(output, text, size);
+ _strlcat(output, text, size);
} else if (strcmp(comp, "action") == 0 && act != MM_NULLACT) {
INSERT_NEWLINE;
- strlcat(output, "TO FIX: ", size);
- strlcat(output, act, size);
+ _strlcat(output, "TO FIX: ", size);
+ _strlcat(output, act, size);
} else if (strcmp(comp, "tag") == 0 && tag != MM_NULLTAG) {
INSERT_SPACE;
- strlcat(output, tag, size);
+ _strlcat(output, tag, size);
}
}
INSERT_NEWLINE;
@@ -171,7 +173,7 @@ nextcomp(const char *msgverb)
char *retval;
if (*lmsgverb == '\0') {
- strlcpy(lmsgverb, msgverb, sizeof(lmsgverb));
+ _strlcpy(lmsgverb, msgverb, sizeof(lmsgverb));
retval = strtok_r(lmsgverb, ":", &state);
} else {
retval = strtok_r(NULL, ":", &state);
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c
index d834d09..da50574 100644
--- a/lib/libc/gen/getgrent.c
+++ b/lib/libc/gen/getgrent.c
@@ -620,7 +620,7 @@ dns_group(void *retval, void *mdata, va_list ap)
* pointer for the member list terminator.
*/
adjsize = bufsize - _ALIGNBYTES - sizeof(char *);
- linesize = strlcpy(buffer, hes[0], adjsize);
+ linesize = _strlcpy(buffer, hes[0], adjsize);
if (linesize >= adjsize) {
*errnop = ERANGE;
rv = NS_RETURN;
@@ -721,7 +721,7 @@ nis_group(void *retval, void *mdata, va_list ap)
rv = NS_NOTFOUND;
switch (how) {
case nss_lt_name:
- if (strlcpy(buffer, name, bufsize) >= bufsize)
+ if (_strlcpy(buffer, name, bufsize) >= bufsize)
goto erange;
break;
case nss_lt_id:
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c
index 427a736..256595b 100644
--- a/lib/libc/gen/getpwent.c
+++ b/lib/libc/gen/getpwent.c
@@ -584,7 +584,7 @@ files_passwd(void *retval, void *mdata, va_list ap)
/* MAXLOGNAME includes NUL byte, but we do not
* include the NUL byte in the key.
*/
- namesize = strlcpy(&keybuf[1], name, sizeof(keybuf)-1);
+ namesize = _strlcpy(&keybuf[1], name, sizeof(keybuf)-1);
if (namesize >= sizeof(keybuf)-1) {
*errnop = EINVAL;
rv = NS_NOTFOUND;
@@ -897,7 +897,7 @@ dns_passwd(void *retval, void *mdata, va_list ap)
hes = NULL;
continue;
}
- linesize = strlcpy(buffer, hes[0], bufsize);
+ linesize = _strlcpy(buffer, hes[0], bufsize);
if (linesize >= bufsize) {
*errnop = ERANGE;
rv = NS_RETURN;
@@ -1055,7 +1055,7 @@ nis_passwd(void *retval, void *mdata, va_list ap)
rv = NS_NOTFOUND;
switch (how) {
case nss_lt_name:
- if (strlcpy(buffer, name, bufsize) >= bufsize)
+ if (_strlcpy(buffer, name, bufsize) >= bufsize)
goto erange;
break;
case nss_lt_id:
@@ -1215,7 +1215,7 @@ compat_use_template(struct passwd *pwd, struct passwd *template, char *buffer,
hold.field = NULL; \
else { \
hold.field = p; \
- p += strlcpy(p, pwd->field, eob-p) + 1; \
+ p += _strlcpy(p, pwd->field, eob-p) + 1; \
} \
} while (0)
COPY(pw_name);
@@ -1233,7 +1233,7 @@ compat_use_template(struct passwd *pwd, struct passwd *template, char *buffer,
pwd->field = NULL; \
else { \
pwd->field = p; \
- if ((n = strlcpy(p, q, eob-p)) >= eob-p) { \
+ if ((n = _strlcpy(p, q, eob-p)) >= eob-p) { \
free(copy); \
return (ERANGE); \
} \
OpenPOWER on IntegriCloud