commit 8b24e72c9459ae0f2501a4d762003de3f2d6f207
parent 0b704fc2079df5c6d568c0bf272d384c0cfd7bd2
Author: Pavel Renev <an2qzavok@gmail.com>
Date: Sat, 17 Aug 2024 00:29:24 +0000
src/fltp: add some debug dumps
Diffstat:
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/fltp/fltp.c b/src/fltp/fltp.c
@@ -75,14 +75,14 @@ fltpgettoken(FLTP *fltp){
int c;
fltp->ti = 0;
for(;;){
- if(fltp->ti >= FLTTokenBufSize) sysfatal("fltp: token buffer overflow");
+ if(fltp->ti >= FLTTokenBufSize) sysfatal("fltpgettoken: token buffer overflow");
c = *fltp->bp;
fltp->bp++;
fltp->nbytes--;
if(strchr(" \t\n", c) != nil) break;
fltp->tbuf[fltp->ti] = c;
fltp->ti++;
- if(fltp->nbytes == 0) sysfatal("fltp: input buffer overflow (unterminated token");
+ if(fltp->nbytes == 0) sysfatal("fltpgettoken: input buffer overflow (unterminated token)");
}
}
@@ -98,19 +98,21 @@ fltpendlist(FLTP *fltp){
void
fltpgetline(FLTP *fltp){
- fprint(2,"getline\n");
FLTNode *new;
int c;
fltp->ti = 0;
for(;;){
- if(fltp->ti >= FLTTokenBufSize) sysfatal("fltp: token buffer overflow");
+ if(fltp->ti >= FLTTokenBufSize) sysfatal("fltpgetline: token buffer overflow");
c = *fltp->bp;
fltp->bp++;
fltp->nbytes--;
if(c == '\n') break;
fltp->tbuf[fltp->ti] = c;
fltp->ti++;
- if(fltp->nbytes == 0) sysfatal("fltp: input buffer overflow (unterminated token");
+ if(fltp->nbytes == 0){
+ fprint(2,"tbuf: %.*s\n", fltp->ti, fltp->tbuf);
+ sysfatal("fltpgetline: input buffer overflow (unterminated token)");
+ }
}
if (fltp->ti > 0) {
new = createfltnode(fltp->np, fltp->np, fltp->tbuf, fltp->ti);