CID 22445 Unchecked return value

This commit is contained in:
Enno Rehling 2015-11-03 23:05:44 +01:00
parent f78fe84216
commit e6973ff394
1 changed files with 6 additions and 1 deletions

View File

@ -97,7 +97,12 @@ char * transliterate(char * out, size_t size, const char * in)
}
else {
ucs4_t ucs;
unicode_utf8_to_ucs4(&ucs, src, &len);
int ret = unicode_utf8_to_ucs4(&ucs, src, &len);
if (ret != 0) {
/* encoding is broken. yikes */
log_error("transliterate | encoding error in '%s'\n", src);
return NULL;
}
src += len;
*dst++ = '?';
--size;