solstice

Compute collected power and efficiencies of a solar plant
git clone git://git.meso-star.com/solstice.git
Log | Files | Refs | README | LICENSE

commit 0c33ceb7b643cb92f2f11452f1a605fb217d4454
parent 36c5dd6f23e96e2e95daced71fe97e776c3f4bf7
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Wed, 22 Feb 2017 16:46:28 +0100

Fix the "yes/no" prompt UI

Diffstat:
Msrc/solstice.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/solstice.c b/src/solstice.c @@ -377,9 +377,10 @@ prompt_yes_no(void) fprintf(stderr, "(y/n) "); val[0] = getc(stdin); - if(val[0] != '\n' && val[0] != '\r') { - val[1] = getc(stdin); - } + if(val[0] == '\n' && val[0] == '\r') + continue; + + val[1] = getc(stdin); if(val[1] != '\n' && val[1] != '\r') { while(getc(stdin) != '\n'); /* Flush stdin */ }