Skip to content

Commit ef3bfd6

Browse files
committed
Fixed error macro to not generate garbage
1 parent 8d3d84f commit ef3bfd6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

GH Injector Library/Error.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ struct ERROR_DATA
294294
#define INIT_ERROR_DATA(data, error) \
295295
data.AdvErrorCode = error; \
296296
data.Line = __LINE__; \
297+
memset(data.szFileName, 0, sizeof(data.szFileName)); \
298+
memset(data.szFunctionName, 0, sizeof(data.szFunctionName)); \
297299
memcpy(data.szFileName, __FILENAMEW__, ((size_t)lstrlenW(__FILENAMEW__)) * 2); \
298300
memcpy(data.szFunctionName, __FUNCTIONW__, ((size_t)lstrlenW(__FUNCTIONW__)) * 2);
299301

0 commit comments

Comments
 (0)