Commit 1488731c810ed76589170909da9ef07f060cef46

Silvio Traversaro 2019-05-21T18:55:39

Merge pull request #52 from pali/master Call FormatMessage() with FORMAT_MESSAGE_IGNORE_INSERTS

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/dlfcn.c b/dlfcn.c
index 69670d1..993808d 100644
--- a/dlfcn.c
+++ b/dlfcn.c
@@ -157,7 +157,7 @@ static void save_err_str( const char *str )
     error_buffer[pos++] = ':';
     error_buffer[pos++] = ' ';
 
-    ret = FormatMessageA( FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwMessageId,
+    ret = FormatMessageA( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dwMessageId,
         MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ),
         error_buffer+pos, (DWORD) (sizeof(error_buffer)-pos), NULL );
     pos += ret;