diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2017-03-09 21:49:11 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2017-03-09 21:49:11 +0000 |
commit | 1bb0ddf99dd04ca8e5363f4c4f4ba42b3a3059a7 (patch) | |
tree | 2da0675626791dabc89f745661f94ea74202027d /usr.bin | |
parent | 12c81769b66d2b36a2e4adbaff663a721c11090b (diff) | |
download | src-1bb0ddf99dd04ca8e5363f4c4f4ba42b3a3059a7.tar.gz src-1bb0ddf99dd04ca8e5363f4c4f4ba42b3a3059a7.zip |
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
MFC after: 5 days
Notes
Notes:
svn path=/head/; revision=314974
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/localedef/ctype.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/localedef/ctype.c b/usr.bin/localedef/ctype.c index 0e238d79080f..c24fdd637844 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,7 +379,7 @@ 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)) |