sfnt2fon: Replace sprintf with snprintf to avoid deprecation warnings on macOS.

This commit is contained in:
Brendan Shanks 2024-09-18 14:20:16 -07:00 committed by Alexandre Julliard
parent b5b7d35600
commit 37307535a2
Notes: Alexandre Julliard 2024-09-19 23:03:14 +02:00
Approved-by: Rémi Bernon (@rbernon)
Approved-by: Huw Davies (@huw)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/6524

View file

@ -881,12 +881,15 @@ int main(int argc, char **argv)
name = get_face_name( info[i] );
fontdir_len += 0x74 + strlen(name) + 1;
if(i == 0) {
sprintf(non_resident_name, "FONTRES 100,%d,%d : %s %d",
snprintf(non_resident_name, sizeof(non_resident_name),
"FONTRES 100,%d,%d : %s %d",
info[i]->hdr.fi.dfVertRes, info[i]->hdr.fi.dfHorizRes,
name, info[i]->hdr.fi.dfPoints );
strcpy(resident_name, name);
} else {
sprintf(non_resident_name + strlen(non_resident_name), ",%d", info[i]->hdr.fi.dfPoints );
snprintf(non_resident_name + strlen(non_resident_name),
sizeof(non_resident_name) - strlen(non_resident_name),
",%d", info[i]->hdr.fi.dfPoints );
}
}