diff options
-rw-r--r-- | win32/win32.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/win32/win32.c b/win32/win32.c index 452883a770..71dbead1b0 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3928,17 +3928,16 @@ poll_child_status(struct ChildRecord *child, int *stat_loc) {STATUS_FLOAT_MULTIPLE_FAULTS, SIGFPE}, {STATUS_FLOAT_MULTIPLE_TRAPS, SIGFPE}, {STATUS_CONTROL_C_EXIT, SIGINT}, - {0, 0} }; int i; - for (i = 0; table[i].status; i++) { + for (i = 0; i < (int)numberof(table); i++) { if (table[i].status == exitcode) { *stat_loc |= table[i].sig; break; } } // if unknown status, assume SEGV - if (!table[i].status) + if (i >= (int)numberof(table)) *stat_loc |= SIGSEGV; } } |