ICNSTranslator: Fix -Wformat-security

Change-Id: Id5b4506b66f43a776b2850c92fd352a7d25ec5a9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3334
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Murai Takashi 2020-10-14 21:08:10 +09:00 committed by Jérôme Duval
parent 1a7208e060
commit 380234c5d8

View File

@ -145,7 +145,7 @@ ICNSTranslator::DerivedIdentify(BPositionIO *stream,
BString iconName("Apple icon");
if (documentCount > 1)
iconName << " #" << documentIndex;
snprintf(info->name, sizeof(info->name), iconName.String());
strlcpy(info->name, iconName.String(), sizeof(info->name));
strcpy(info->MIME, kICNSMimeType);
return B_OK;