diff options
Diffstat (limited to 'compat/mingw.c')
-rw-r--r-- | compat/mingw.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compat/mingw.c b/compat/mingw.c index 1d70f649fb..5edea29508 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -2148,11 +2148,13 @@ void mingw_startup() int uname(struct utsname *buf) { - DWORD v = GetVersion(); + unsigned v = (unsigned)GetVersion(); memset(buf, 0, sizeof(*buf)); - strcpy(buf->sysname, "Windows"); - sprintf(buf->release, "%u.%u", v & 0xff, (v >> 8) & 0xff); + xsnprintf(buf->sysname, sizeof(buf->sysname), "Windows"); + xsnprintf(buf->release, sizeof(buf->release), + "%u.%u", v & 0xff, (v >> 8) & 0xff); /* assuming NT variants only.. */ - sprintf(buf->version, "%u", (v >> 16) & 0x7fff); + xsnprintf(buf->version, sizeof(buf->version), + "%u", (v >> 16) & 0x7fff); return 0; } |