Commit 26201ca9 authored by Brendan Shanks's avatar Brendan Shanks Committed by Alexandre Julliard

winemac.drv: Replace sprintf with snprintf to avoid deprecation warnings.

parent 4a05c631
...@@ -569,7 +569,7 @@ static void *import_html(CFDataRef data, size_t *ret_size) ...@@ -569,7 +569,7 @@ static void *import_html(CFDataRef data, size_t *ret_size)
if ((ret = malloc(total))) if ((ret = malloc(total)))
{ {
char *p = ret; char *p = ret;
p += sprintf(p, header, total - 1, len, len + size + 1 /* include the final \n in the data */); p += snprintf(p, total, header, total - 1, len, len + size + 1 /* include the final \n in the data */);
CFDataGetBytes(data, CFRangeMake(0, size), (UInt8*)p); CFDataGetBytes(data, CFRangeMake(0, size), (UInt8*)p);
strcpy(p + size, trailer); strcpy(p + size, trailer);
*ret_size = total; *ret_size = total;
......
...@@ -1361,7 +1361,7 @@ INT macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size) ...@@ -1361,7 +1361,7 @@ INT macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size)
if (!len) if (!len)
{ {
char name[16]; char name[16];
len = sprintf(name, "Key 0x%02x", vkey); len = snprintf(name, sizeof(name), "Key 0x%02x", vkey);
len = min(len + 1, size); len = min(len + 1, size);
ascii_to_unicode(buffer, name, len); ascii_to_unicode(buffer, name, len);
if (len) buffer[--len] = 0; if (len) buffer[--len] = 0;
......
...@@ -131,13 +131,13 @@ HKEY open_hkcu_key(const char *name) ...@@ -131,13 +131,13 @@ HKEY open_hkcu_key(const char *name)
return 0; return 0;
sid = ((TOKEN_USER *)sid_data)->User.Sid; sid = ((TOKEN_USER *)sid_data)->User.Sid;
len = sprintf(buffer, "\\Registry\\User\\S-%u-%u", sid->Revision, len = snprintf(buffer, sizeof(buffer), "\\Registry\\User\\S-%u-%u", sid->Revision,
(unsigned int)MAKELONG(MAKEWORD(sid->IdentifierAuthority.Value[5], (unsigned int)MAKELONG(MAKEWORD(sid->IdentifierAuthority.Value[5],
sid->IdentifierAuthority.Value[4]), sid->IdentifierAuthority.Value[4]),
MAKEWORD(sid->IdentifierAuthority.Value[3], MAKEWORD(sid->IdentifierAuthority.Value[3],
sid->IdentifierAuthority.Value[2]))); sid->IdentifierAuthority.Value[2])));
for (i = 0; i < sid->SubAuthorityCount; i++) for (i = 0; i < sid->SubAuthorityCount; i++)
len += sprintf(buffer + len, "-%u", (unsigned int)sid->SubAuthority[i]); len += snprintf(buffer + len, sizeof(buffer) - len, "-%u", (unsigned int)sid->SubAuthority[i]);
ascii_to_unicode(bufferW, buffer, len); ascii_to_unicode(bufferW, buffer, len);
hkcu = reg_open_key(NULL, bufferW, len * sizeof(WCHAR)); hkcu = reg_open_key(NULL, bufferW, len * sizeof(WCHAR));
......
...@@ -187,7 +187,7 @@ CFStringRef copy_system_cursor_name(ICONINFOEXW *info) ...@@ -187,7 +187,7 @@ CFStringRef copy_system_cursor_name(ICONINFOEXW *info)
else else
{ {
char buf[16]; char buf[16];
sprintf(buf, "%hu", info->wResID); snprintf(buf, sizeof(buf), "%hu", info->wResID);
asciiz_to_unicode(p, buf); asciiz_to_unicode(p, buf);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment