Make sure line counting doesn't move past end of string

darcs-hash:20060206134757-ac50b-2e80cf3ec104f7b40babef5260fb1d5435dbc74d.gz
This commit is contained in:
axel 2006-02-06 23:47:57 +10:00
parent a521fa4165
commit 530bbfc9ac

View file

@ -58,7 +58,7 @@ int parse_util_lineno( const wchar_t *str, int len )
} }
} }
for( ; i<len; i++ ) for( ; str[i] && i<len; i++ )
{ {
if( str[i] == L'\n' ) if( str[i] == L'\n' )
res++; res++;