summaryrefslogtreecommitdiffstats
path: root/lib/libc/nls/msgcat.c
diff options
context:
space:
mode:
authorphantom <phantom@FreeBSD.org>2000-09-05 12:23:08 +0000
committerphantom <phantom@FreeBSD.org>2000-09-05 12:23:08 +0000
commit5b566d9d01d072d456740cae54fe4e1b24a795e2 (patch)
treec8f8399af1772e40fff7ccbcecb9b832505fdd59 /lib/libc/nls/msgcat.c
parent6ff92c14b7a65f64dea4e0d4e8d19b2dcf3f57b3 (diff)
downloadFreeBSD-src-5b566d9d01d072d456740cae54fe4e1b24a795e2.zip
FreeBSD-src-5b566d9d01d072d456740cae54fe4e1b24a795e2.tar.gz
Oops! don't set errno to ENOMEM explicitly if malloc() failed.
Found by: ache
Diffstat (limited to 'lib/libc/nls/msgcat.c')
-rw-r--r--lib/libc/nls/msgcat.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c
index c5ea4a3..bf24d82 100644
--- a/lib/libc/nls/msgcat.c
+++ b/lib/libc/nls/msgcat.c
@@ -259,13 +259,17 @@ catclose( catd)
/* Note that only malloc failures are allowed to return an error */
static char* _errowner = "Message Catalog System";;
-#define PROBLEM(err, msg) { \
- fprintf(stderr, msg, _errowner); \
- free(cat); \
- NLRETERR(err); \
+#define CORRUPT() { \
+ fprintf(stderr, "%s: currupt file.", _errowner); \
+ free(cat); \
+ NLRETERR(EINVAL); \
+ }
+
+#define NOSPACE() { \
+ fprintf(stderr, "%s: no more memory.", _errowner); \
+ free(cat); \
+ return(NLERR); \
}
-#define CORRUPT() PROBLEM(EINVAL, "%s: corrupt file.\n")
-#define NOSPACE() PROBLEM(ENOMEM, "%s: no more memory.\n")
static void
__nls_free_resources(cat, i)
OpenPOWER on IntegriCloud