Following up from the reddit announcement

Steven Schveighoffer schveiguy at yahoo.com
Mon Feb 24 14:15:11 PST 2014


On Mon, 24 Feb 2014 17:05:46 -0500, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> What's the matter with http://dpaste.dzfl.pl/ebd6ba43823f?

This is what happens when you close input (i.e. hit ctrl-d from a  
console), without entering -1.

readf is returning 0 meaning "I didn't get anything" and the code is  
ignoring it.

I changed it to:

if(readf("%s\n", &input) == 0)
             break;

And it works fine. Note I had to add \n to the readf to use a  
one-number-per-line style (didn't make sense otherwise).

-Steve


More information about the Digitalmars-d mailing list