diff options
Diffstat (limited to 'src/shared.c')
| -rw-r--r-- | src/shared.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/shared.c b/src/shared.c index b6d27e4..1dd0309 100644 --- a/src/shared.c +++ b/src/shared.c | |||
| @@ -29,8 +29,10 @@ | |||
| 29 | 29 | ||
| 30 | //! Macro to exit on an alloc error instead of doing the terrible nested if statement that was being used previously | 30 | //! Macro to exit on an alloc error instead of doing the terrible nested if statement that was being used previously |
| 31 | #define XALLOC_EXIT(msg, ...) do { \ | 31 | #define XALLOC_EXIT(msg, ...) do { \ |
| 32 | if(___VXGG___VERBOSE_ERRORS___) error(EXIT_FAILURE, errno, (msg)__VA_ARGS__); \ | 32 | if(___VXGG___VXALLOC_EXIT_ON_ERROR___) { \ |
| 33 | if(___VXGG___VXALLOC_EXIT_ON_ERROR___) exit(EXIT_FAILURE); \ | 33 | if(___VXGG___VERBOSE_ERRORS___) error(EXIT_FAILURE, errno, (msg)__VA_ARGS__); \ |
| 34 | exit(EXIT_FAILURE); \ | ||
| 35 | } \ | ||
| 34 | abort(); \ | 36 | abort(); \ |
| 35 | } while (0) | 37 | } while (0) |
| 36 | 38 | ||
| @@ -102,6 +104,7 @@ int rwbuf(char **str, unsigned long int initsize, int fd) { | |||
| 102 | ERR_rwbuf: | 104 | ERR_rwbuf: |
| 103 | if(___VXGG___VERBOSE_ERRORS___) { | 105 | if(___VXGG___VERBOSE_ERRORS___) { |
| 104 | switch (eflag) { | 106 | switch (eflag) { |
| 107 | case 0: break; | ||
| 105 | case 1: WARN(errno, "Could not reallocate enough space for lstr",); break; | 108 | case 1: WARN(errno, "Could not reallocate enough space for lstr",); break; |
| 106 | case 2: WARN(errno, "Ran into a read() error",); break; | 109 | case 2: WARN(errno, "Ran into a read() error",); break; |
| 107 | case 3: WARN(errno, "Could not shrink lstr after reading buffer",); break; | 110 | case 3: WARN(errno, "Could not shrink lstr after reading buffer",); break; |
