From 0402d46e438f4befd4263af89287a025ab5819a2 Mon Sep 17 00:00:00 2001 From: sezero Date: Thu, 23 Aug 2018 15:37:20 +0300 Subject: [PATCH] fxos.c, fxGethostname: fix a strict aliasing issue --- swlibs/fxmisc/fxos.c | 4 ++-- swlibs/fxmisc/fxos.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/swlibs/fxmisc/fxos.c b/swlibs/fxmisc/fxos.c index 08272d2..29ff560 100644 --- a/swlibs/fxmisc/fxos.c +++ b/swlibs/fxmisc/fxos.c @@ -32,9 +32,9 @@ void sleep(int secs) Sleep(secs * 1000); } -int fxGethostname(char *name, int n) +int fxGethostname(char *name, unsigned long n) { - return (int)GetComputerName((LPTSTR)name,(LPDWORD)&n); + return (int) GetComputerNameA((LPTSTR)name, &n); } #else #include diff --git a/swlibs/fxmisc/fxos.h b/swlibs/fxmisc/fxos.h index d29ac97..3942e99 100644 --- a/swlibs/fxmisc/fxos.h +++ b/swlibs/fxmisc/fxos.h @@ -31,7 +31,7 @@ extern "C" { void sleep(int secs); #define gethostname fxGethostname -int gethostname(char *name, int namelen); +int gethostname(char *name, unsigned long namelen); # endif