diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2002-08-09 08:22:29 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2002-08-09 08:22:29 +0000 |
commit | ec5ca2eba75a21d9b9c2ce4e9114b1246b4f5fcd (patch) | |
tree | ec50b36d8d16a98023a55c6c494ff75a89b994db /lib/libc/locale/rune.c | |
parent | 4ecb22fb960ebb59472ab03e9a03321108b93100 (diff) | |
download | src-ec5ca2eba75a21d9b9c2ce4e9114b1246b4f5fcd.tar.gz src-ec5ca2eba75a21d9b9c2ce4e9114b1246b4f5fcd.zip |
Add safeguards to never use errno == 0 as setrunelocale() error return code
Notes
Notes:
svn path=/head/; revision=101566
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 63a50de4c755..1783cba8965e 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 */ |