JPEGTranslator: Replace strncpy() with strlcpy()
Replace strncpy() with strlcpy(), since destination size equals maximum number of characters to copy. Pointed by gcc8 [-Werror=stringop-truncation]. Change-Id: I3e2a98802ddb379890aefaf8c3f0efb1cd347188
This commit is contained in:
parent
e2d19ae5b7
commit
c7eabc40dc
@ -1281,7 +1281,7 @@ JPEGTranslator::PopulateInfoFromFormat(translator_info* info,
|
||||
BString str1(formats[i].name);
|
||||
str1.ReplaceFirst("Be Bitmap Format (JPEGTranslator)",
|
||||
B_TRANSLATE("Be Bitmap Format (JPEGTranslator)"));
|
||||
strncpy(info->name, str1.String(), sizeof(info->name));
|
||||
strlcpy(info->name, str1.String(), sizeof(info->name));
|
||||
strcpy(info->MIME, formats[i].MIME);
|
||||
return B_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user