(readline): Change position on %n and \" in sscanf.

This commit is contained in:
Jan Djärv 2006-08-09 06:56:16 +00:00
parent 1f4edc37b8
commit ea90c5d3bd
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,7 @@
2006-08-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
* etags.c (readline): expect sscanf returns >= 1.
(readline): Change position on %n and \" in sscanf.
2006-08-07 Masatake YAMATO <jet@gyve.org>

View file

@ -6259,9 +6259,10 @@ readline (lbp, stream)
int start, lno;
if (DEBUG) start = 0; /* shut up the compiler */
if (sscanf (lbp->buffer, "#line %d \"%n", &lno, &start) >= 1)
if (sscanf (lbp->buffer, "#line %d %n\"", &lno, &start) >= 1
&& inp[start] == '"')
{
char *endp = lbp->buffer + start;
char *endp = lbp->buffer + ++start;
assert (start > 0);
while ((endp = etags_strchr (endp, '"')) != NULL