Mail Archives: cygwin/2000/03/15/11:13:45
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Hi Folks,
<p>This message documents a problem with sscanf() %n format specification
which began, to the best of my knowledge, with the 20000221 snapshot.
This problem did not exist in the 20000211 snapshot. I'm using Windows98
and Cygwin Beta 20.1 with upgrades consisting of Mumit's 2.95.2 compiler
and the 200000221 snapshot.
<p>Compiling the following using "g++ sscanfBug.C -o sscanfBug.exe"
<blockquote>#include <stdio.h>
<br>#include <iostream>
<p>int main () {
<p> const char *str = "0.02";
<br> double num;
<br> int len;
<p> cerr << "str is <" << str <<
">\n";
<p> sscanf( str, "%lf%n", &num, &len );
<p> cerr << "num is <" << num <<
">\n";
<br> cerr << "len is <" << len <<
">\n";
<br>}</blockquote>
produces an executable which, when run, writes the following to standard
error:
<blockquote>str is <0.02>
<br>num is <0.02>
<br>len is <2></blockquote>
The correct value for len is 4. Please note that this is not the
same problem discussed on this mailing list last June. Specifically,
there is no space preceding %n. I apologize in advance for not presenting
you with a patch; after briefly attempting to track this bug myself, I
realized that I wasn't getting anywhere.
<p>Hope this helps,
<br>Mark Rahner</html>
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
- Raw text -