From c8d69c99f4107b015af312475081ab30304b091e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Wed, 3 Aug 2016 20:08:53 +0200 Subject: [PATCH] Make format_string_code capable of handling native pointers --- src/localisation/localisation.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/localisation/localisation.c b/src/localisation/localisation.c index 408834d51d..f62af11aa9 100644 --- a/src/localisation/localisation.c +++ b/src/localisation/localisation.c @@ -905,7 +905,7 @@ static void format_realtime(char ** dest, uint16 value) static void format_string_code(unsigned int format_code, char **dest, char **args) { - int value; + intptr_t value; switch (format_code) { case FORMAT_COMMA32: @@ -975,8 +975,8 @@ static void format_string_code(unsigned int format_code, char **dest, char **arg break; case FORMAT_STRING: // Pop argument - value = *((uint32*)*args); - *args += 4; + value = *((uintptr_t*)*args); + *args += sizeof(uintptr_t); if (value != 0) { strcpy(*dest, (char*)value); @@ -1038,7 +1038,7 @@ static void format_string_code(unsigned int format_code, char **dest, char **arg *args += 4; *(*dest)++ = 23; - *((uint32*)(*dest)) = value; + *((intptr_t*)(*dest)) = value; *dest += 4; break; }