make buffer_get_token write \0 to buffer on end of file so it can be

distinguished from a length 0 token.
This commit is contained in:
leitner
2002-05-11 15:19:56 +00:00
parent a11c1f8ec0
commit 12fbaf7c9c
3 changed files with 7 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ int buffer_get_token(buffer* b,char* x,unsigned int len,const char* charset,unsi
for (blen=0;blen<len;++blen) {
register int r;
if ((r=buffer_getc(b,x))<0) return r;
if (r==0) break;
if (r==0) { *x=0; break; }
if (byte_chr(charset,setlen,*x)<setlen) break;
++x;
}