Update to br_ips

Move FATAL_ERROR definition to header
Terminate strings read by getline with NUL
This commit is contained in:
PikalaxALT
2019-06-24 13:50:37 -04:00
parent f18fcb9fbd
commit e786deb7f6
5 changed files with 44 additions and 64 deletions
+27
View File
@@ -0,0 +1,27 @@
#ifndef GUARD_BR_IPS_GLOBAL_H
#define GUARD_BR_IPS_GLOBAL_H
#ifdef _MSC_VER
#define FATAL_ERROR(format, ...) \
do { \
fprintf(stderr, format, __VA_ARGS__); \
exit(1); \
} while (0)
#else
#define FATAL_ERROR(format, ...) \
do { \
fprintf(stderr, format, ##__VA_ARGS__); \
exit(1); \
} while (0)
#endif // _MSC_VER
typedef struct Hunk {
uint32_t offset;
size_t size;
} hunk_t;
#endif //GUARD_BR_IPS_GLOBAL_H