diff options
author | pfg <pfg@FreeBSD.org> | 2017-03-14 02:13:59 +0000 |
---|---|---|
committer | pfg <pfg@FreeBSD.org> | 2017-03-14 02:13:59 +0000 |
commit | e06e586c2f3b8d707fe016b3a038e1148080fa0a (patch) | |
tree | f04580c25e6b038b99922da222a1ce35abdd7398 /usr.bin | |
parent | f3584df197214b997bc9ae927780e03c37c9e36c (diff) | |
download | FreeBSD-src-e06e586c2f3b8d707fe016b3a038e1148080fa0a.zip FreeBSD-src-e06e586c2f3b8d707fe016b3a038e1148080fa0a.tar.gz |
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
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/localedef/ctype.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/localedef/ctype.c b/usr.bin/localedef/ctype.c index 0e238d7..165ee9b 100644 --- a/usr.bin/localedef/ctype.c +++ b/usr.bin/localedef/ctype.c @@ -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++; |