}
}
}
- buf += strcspn(buf, "\n") + 1;
+ buf += strcspn(buf, "\n");
+ buf += !!*buf;
}
return buf;
}
char new_line[2];
int text_len = 0;
- while (*buf) {
+ while (buf && *buf) {
if (text && callbacks->text &&
(sscanf(buf, "\\%1[nN]", new_line) == 1 ||
!strncmp(buf, "{\\", 2))) {