summaryrefslogtreecommitdiffstats
path: root/Source/cmakewizard.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2009-10-02 19:30:01 (GMT)
committerDavid Cole <david.cole@kitware.com>2009-10-02 19:30:01 (GMT)
commitccb0cf130673b55035106067997e9d135d4d27fa (patch)
treead0e4fe75d4036e576a6b2992a15baeb7c79fcb8 /Source/cmakewizard.cxx
parent837364cb04a53a0fd3f5150da4f56524066fe2a7 (diff)
downloadCMake-ccb0cf130673b55035106067997e9d135d4d27fa.zip
CMake-ccb0cf130673b55035106067997e9d135d4d27fa.tar.gz
CMake-ccb0cf130673b55035106067997e9d135d4d27fa.tar.bz2
Fix warnings in CMake source code.
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')