From 63a823f8f40d4e60eeaaf80570e9991e81c2ef18 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 22 Oct 2003 08:45:01 +0000 Subject: [PATCH] * libc/stdlib/exit.c (exit): Handle null _GLOBAL_REENT->_atexits. --- newlib/ChangeLog | 4 ++++ newlib/libc/stdlib/exit.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 74495c317..0af6c34a6 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2003-10-22 Richard Sandiford + + * libc/stdlib/exit.c (exit): Handle null _GLOBAL_REENT->_atexits. + 2003-10-20 Bob Wilson * libc/locale/locale.c: Use double quotes in code. diff --git a/newlib/libc/stdlib/exit.c b/newlib/libc/stdlib/exit.c index dad2861d2..be96488c8 100644 --- a/newlib/libc/stdlib/exit.c +++ b/newlib/libc/stdlib/exit.c @@ -83,7 +83,7 @@ _DEFUN (exit, (code), } #else p = _GLOBAL_REENT->_atexit; - do + while (p) { args = & p->_on_exit_args; @@ -95,7 +95,6 @@ _DEFUN (exit, (code), p = p->_next; } - while (p); #endif if (_GLOBAL_REENT->__cleanup)