diff options
author | pfg <pfg@FreeBSD.org> | 2017-11-27 02:43:27 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2017-11-27 02:43:27 +0000 |
commit | 07d322c997ca8a03db61d2e3a5560cb1ec28da4a (patch) | |
tree | 882fbb895e5996c94f9a725ce0e8af9afb9f0042 /lib/libc | |
parent | 49e9a8f7208f2faf12885e811e6353adcd1401d1 (diff) | |
download | FreeBSD-src-07d322c997ca8a03db61d2e3a5560cb1ec28da4a.zip FreeBSD-src-07d322c997ca8a03db61d2e3a5560cb1ec28da4a.tar.gz |
MFC r326028:
iconv: Fix a pointer mismatch.
Catch NULL pointer earlier, check for empty string later.
Apparently this fixes a GCC8 warning.
Obtained from: NetBSD (CVS Rev. 1.21, 1.22) through DragonFlyBSD
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/iconv/citrus_none.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/iconv/citrus_none.c b/lib/libc/iconv/citrus_none.c index 9ec4bd3..56e157a 100644 --- a/lib/libc/iconv/citrus_none.c +++ b/lib/libc/iconv/citrus_none.c @@ -1,5 +1,5 @@ /* $FreeBSD$ */ -/* $NetBSD: citrus_none.c,v 1.18 2008/06/14 16:01:07 tnozaki Exp $ */ +/* $NetBSD: citrus_none.c,v 1.22 2017/07/13 16:00:30 christos Exp $ */ /*- * Copyright (c) 2002 Citrus Project, @@ -164,7 +164,7 @@ _citrus_NONE_stdenc_mbtowc(struct _citrus_stdenc * __restrict ce __unused, struct iconv_hooks *hooks) { - if (s == NULL) { + if (*s == NULL) { *nresult = 0; return (0); } @@ -176,7 +176,7 @@ _citrus_NONE_stdenc_mbtowc(struct _citrus_stdenc * __restrict ce __unused, if (pwc != NULL) *pwc = (_wc_t)(unsigned char) **s; - *nresult = *s == '\0' ? 0 : 1; + *nresult = **s == '\0' ? 0 : 1; if ((hooks != NULL) && (hooks->wc_hook != NULL)) hooks->wc_hook(*pwc, hooks->data); |