Fix registering of files to be cleaned up to work with multiple files.

pull/2/head
Markus Böhme 2017-03-14 14:11:08 +01:00
parent 7341de31ca
commit 99e568f55b
1 changed files with 5 additions and 3 deletions

View File

@ -36,9 +36,11 @@ cleanup_register(FILE *file, const char *name)
if (file) {
unsigned i;
for (i = 0; i < sizeof(cleanup) / sizeof(*cleanup); i++) {
cleanup[i].name = name;
cleanup[i].file = file;
return;
if (!cleanup[i].name) {
cleanup[i].name = name;
cleanup[i].file = file;
return;
}
}
}
abort();