Fixed iteration when all callback slots are occupied

This commit is contained in:
rxi 2020-06-20 12:42:34 +01:00
parent 822e6c8b1b
commit f9ea34994b

View File

@ -154,7 +154,7 @@ void log_log(int level, const char *file, int line, const char *fmt, ...) {
va_end(ev.ap); va_end(ev.ap);
} }
for (int i = 0; L.callbacks[i].fn; i++) { for (int i = 0; i < MAX_CALLBACKS && L.callbacks[i].fn; i++) {
Callback *cb = &L.callbacks[i]; Callback *cb = &L.callbacks[i];
if (level >= cb->level) { if (level >= cb->level) {
init_event(&ev, cb->udata); init_event(&ev, cb->udata);