[Issue 14315] [snn] scanf can't read lines longer than 32767 characters

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Mar 21 15:12:32 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14315

--- Comment #3 from Ivan Kazmenko <gassa at mail.ru> ---
(In reply to FG from comment #2)
> I can confirm the problem. Interestingly, it occurs when trying to scanf a
> long string without whitespace immediately followed by \r\n. There was no
> problem when the line ended with just a \n, didn't end at all, or when the
> string was followed by whitespace and some other chars.

Hmm, this is not the case here.  What system do you use for testing?

Either converting line endings dos2unix, removing end-of-line sequence
completely, or using any of the two following generators, I still get 32767:

gen2.d (generate two long words on a line)
-----
import std.range, std.stdio;
void main () {'a'.repeat (50000).repeat (2).join (' ').writeln;}
-----

gen3.d (generate one long and one short word on a line)
-----
import std.range, std.stdio;
void main () {['a'.repeat (100000).array, "b"].join (' ').writeln;}
-----

--


More information about the Digitalmars-d-bugs mailing list