Date: Tue, 14 Mar 2017 02:13:59 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315224 - stable/11/usr.bin/localedef Message-ID: <201703140213.v2E2DxmV074842@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Tue Mar 14 02:13:59 2017 New Revision: 315224 URL: https://svnweb.freebsd.org/changeset/base/315224 Log: MFC r314974, r315006: localedef(1): Fix small coverity issues. - Operands don't affect result (CONSTANT_EXPRESSION_RESULT) - Buffer not null terminated (BUFFER_SIZE_WARNING) CID: 1338557, 1338565 Obtained from: illumos Modified: stable/11/usr.bin/localedef/ctype.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/localedef/ctype.c ============================================================================== --- stable/11/usr.bin/localedef/ctype.c Tue Mar 14 02:10:37 2017 (r315223) +++ stable/11/usr.bin/localedef/ctype.c Tue Mar 14 02:13:59 2017 (r315224) @@ -306,7 +306,7 @@ dump_ctype(void) return; (void) memcpy(rl.magic, _FILE_RUNE_MAGIC_1, 8); - (void) strncpy(rl.encoding, get_wide_encoding(), sizeof (rl.encoding)); + (void) strlcpy(rl.encoding, get_wide_encoding(), sizeof (rl.encoding)); /* * Initialize the identity map. @@ -379,12 +379,12 @@ dump_ctype(void) if ((ctn->ctype & _ISALPHA) && (ctn->ctype & (_ISPUNCT|_ISDIGIT))) conflict++; - if ((ctn->ctype & _ISPUNCT) & + if ((ctn->ctype & _ISPUNCT) && (ctn->ctype & (_ISDIGIT|_ISALPHA|_ISXDIGIT))) conflict++; if ((ctn->ctype & _ISSPACE) && (ctn->ctype & _ISGRAPH)) conflict++; - if ((ctn->ctype & _ISCNTRL) & _ISPRINT) + if ((ctn->ctype & _ISCNTRL) && (ctn->ctype & _ISPRINT)) conflict++; if ((wc == ' ') && (ctn->ctype & (_ISPUNCT|_ISGRAPH))) conflict++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703140213.v2E2DxmV074842>