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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user