summaryrefslogtreecommitdiffstats
path: root/Source/cmakewizard.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmakewizard.cxx')
-rw-r--r--Source/cmakewizard.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx
index 1dcfcc1..cd427cb 100644
--- a/Source/cmakewizard.cxx
+++ b/Source/cmakewizard.cxx
@@ -28,8 +28,10 @@ void cmakewizard::AskUser(const char* key,
printf("Current Value: %s\n", iter.GetValue());
printf("New Value (Enter to keep current value): ");
char buffer[4096];
- buffer[0] = 0;
- (void) fgets(buffer, sizeof(buffer)-1, stdin);
+ if(!fgets(buffer, sizeof(buffer)-1, stdin))
+ {
+ buffer[0] = 0;
+ }
if(strlen(buffer) > 0)
{
@@ -65,8 +67,10 @@ bool cmakewizard::AskAdvanced()
{
printf("Would you like to see advanced options? [No]:");
char buffer[4096];
- buffer[0] = 0;
- (void) fgets(buffer, sizeof(buffer)-1, stdin);
+ if(!fgets(buffer, sizeof(buffer)-1, stdin))
+ {
+ buffer[0] = 0;
+ }
if(buffer[0])
{
if(buffer[0] == 'y' || buffer[0] == 'Y')