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

This commit is contained in:
Brendan Shanks 2024-09-18 14:20:07 -07:00 committed by Alexandre Julliard
parent b6aed99a75
commit 7037201214
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
2 changed files with 5 additions and 5 deletions

View file

@ -907,12 +907,12 @@ static void expand_special(pp_entry_t *ppp)
if(!strcmp(ppp->ident, "__LINE__"))
{
buf = xrealloc(buf, 32);
sprintf(buf, "%d", pp_status.line_number);
snprintf(buf, 32, "%d", pp_status.line_number);
}
else if(!strcmp(ppp->ident, "__FILE__"))
{
buf = xrealloc(buf, strlen(pp_status.input) + 3);
sprintf(buf, "\"%s\"", pp_status.input);
snprintf(buf, strlen(pp_status.input) + 3, "\"%s\"", pp_status.input);
}
if(pp_flex_debug)

View file

@ -209,11 +209,11 @@ static void set_version_defines(void)
major = NULL;
patchlevel = version;
}
sprintf( buffer, "__WRC__=%s", major ? major : "0" );
snprintf( buffer, sizeof(buffer), "__WRC__=%s", major ? major : "0" );
wpp_add_cmdline_define(buffer);
sprintf( buffer, "__WRC_MINOR__=%s", minor ? minor : "0" );
snprintf( buffer, sizeof(buffer), "__WRC_MINOR__=%s", minor ? minor : "0" );
wpp_add_cmdline_define(buffer);
sprintf( buffer, "__WRC_PATCHLEVEL__=%s", patchlevel ? patchlevel : "0" );
snprintf( buffer, sizeof(buffer), "__WRC_PATCHLEVEL__=%s", patchlevel ? patchlevel : "0" );
wpp_add_cmdline_define(buffer);
free( version );
}