I\'m probably just stupid:
fileref_t *fref; while (gli_filereflist != NULL) { fref = gli_filereflist; if (fref != NULL) {