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
This commit is contained in:
Pedro F. Giffuni 2017-03-09 21:49:11 +00:00
parent 12c81769b6
commit 1bb0ddf99d

View File

@ -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))