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:
Murai Takashi 2018-05-13 19:56:36 +09:00 committed by waddlesplash
parent e2d19ae5b7
commit c7eabc40dc

View File

@ -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;
}