- while ((size = getline(&line, &nb, fp)) != -1) {
- if (total + size > nbmem) {
- DBG("Reallocating event list from %zd to %zd bytes", nbmem,
- total + size + KERNEL_EVENT_LIST_SIZE);
+ while ((size = fscanf(fp, "event { name = %m[^;]; };%n\n", &event, &pos)) == 1) {
+ if (count > nbmem) {
+ DBG("Reallocating event list from %zu to %zu bytes", nbmem,
+ nbmem + KERNEL_EVENT_LIST_SIZE);