* lib/commonio.c: Avoid pre-decrement operator (--n). Add some

comments.
	* libmisc/cleanup.c: Fix off by one in an assertion.
This commit is contained in:
nekral-guest
2009-09-08 21:00:12 +00:00
parent a845c67c60
commit 1e51ab0b23
3 changed files with 12 additions and 2 deletions

View File

@ -109,7 +109,8 @@ void del_cleanup (cleanup_function pcf)
/* Move the rest of the cleanup functions */
for (; i<CLEANUP_FUNCTIONS; i++) {
/* Make sure the cleanup function was specified only once */
assert (cleanup_functions[i+1] != pcf);
assert ( (i == (CLEANUP_FUNCTIONS -1))
|| (cleanup_functions[i+1] != pcf));
if (i == (CLEANUP_FUNCTIONS -1)) {
cleanup_functions[i] = NULL;