Mail Archives: djgpp-workers/2004/03/31/09:15:31
> Some time since I heared anything on this thread. So I'll assume it's
> fixed in the latest snapshot.
Not to my knowledge.
> Otherwise I have this sscanf() bug (?) that's causing me trouble.
> Example:
>
> #include <stdio.h>
> #include <stdlib.h>
> int main (int argc, char **argv)
> {
> int rc;
> char *url = argc > 1 ? argv[1] : "";
> char proto[64] = "";
> char host[512] = "";
> char path[512] = "";
>
> rc = sscanf (url, "%64[^:]://%512[^/?]%512s",
> proto, host, path);
> printf ("sscanf(): %d, proto `%s', host `%s', path `%s'\n",
> rc, proto, host, path);
> return (0);
> }
> ----------------------
>
> For "scanf.exe http://host", this prints
> sscanf(): -1, proto `http', host `host', path `'
>
> I'd expected rc == 2. As djgpp 2.03, HighC and Watcom returns.
Yes, that looks like the same thing that I found. I'll try it with my
patch if/when I find time.
> My doscanf.c is dated 23 Nov 2003 (from 2.04 beta 1 I believe)
> Is there a fixed newer version somewhere?
Apply my patch and verify...
> http://www.ludd.luth.se/~ams/djgpp/cvs/djgpp/src/libc/ansi/stdio/doscan.c
> has a date of 24 Nov 2003.
And as the TIMESTAMP (at the top level) gives a recent date that is
when it was last updated so my correction has not been commited
yet. I'll do that soon (my time permitting).
Right,
MartinS
- Raw text -