summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/fmtmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/fmtmsg.c')
-rw-r--r--lib/libc/gen/fmtmsg.c22
1 files changed, 12 insertions, 10 deletions
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);
OpenPOWER on IntegriCloud