diff options
author | ache <ache@FreeBSD.org> | 2002-08-09 08:22:29 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2002-08-09 08:22:29 +0000 |
commit | 9d73d0dd122e2ce7df338d16beff65b7bbbc42c5 (patch) | |
tree | ec50b36d8d16a98023a55c6c494ff75a89b994db /lib/libc/locale/rune.c | |
parent | b11e88aa0eb39e0a14d792aeaf714fbbf091e7eb (diff) | |
download | FreeBSD-src-9d73d0dd122e2ce7df338d16beff65b7bbbc42c5.zip FreeBSD-src-9d73d0dd122e2ce7df338d16beff65b7bbbc42c5.tar.gz |
Add safeguards to never use errno == 0 as setrunelocale() error return code
Diffstat (limited to 'lib/libc/locale/rune.c')
-rw-r--r-- | lib/libc/locale/rune.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/libc/locale/rune.c b/lib/libc/locale/rune.c index 63a50de..1783cba 100644 --- a/lib/libc/locale/rune.c +++ b/lib/libc/locale/rune.c @@ -70,10 +70,8 @@ _Read_RuneMagi(fp) return (NULL); } - if ((data = malloc(sb.st_size)) == NULL) { - errno = ENOMEM; + if ((data = malloc(sb.st_size)) == NULL) return (NULL); - } errno = 0; rewind(fp); /* Someone might have read the magic number once already */ |