diff options
author | David Cole <david.cole@kitware.com> | 2009-10-02 19:30:01 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2009-10-02 19:30:01 (GMT) |
commit | ccb0cf130673b55035106067997e9d135d4d27fa (patch) | |
tree | ad0e4fe75d4036e576a6b2992a15baeb7c79fcb8 /Source/cmSystemTools.cxx | |
parent | 837364cb04a53a0fd3f5150da4f56524066fe2a7 (diff) | |
download | CMake-ccb0cf130673b55035106067997e9d135d4d27fa.zip CMake-ccb0cf130673b55035106067997e9d135d4d27fa.tar.gz CMake-ccb0cf130673b55035106067997e9d135d4d27fa.tar.bz2 |
Fix warnings in CMake source code.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r-- | Source/cmSystemTools.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 0af46c1..219c1ef 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -915,8 +915,10 @@ bool RunCommandViaPopen(const char* command, #endif return false; } - buffer[0] = 0; - (void) fgets(buffer, BUFFER_SIZE, cpipe); + if (!fgets(buffer, BUFFER_SIZE, cpipe)) + { + buffer[0] = 0; + } while(!feof(cpipe)) { if(verbose) @@ -924,8 +926,10 @@ bool RunCommandViaPopen(const char* command, cmSystemTools::Stdout(buffer); } output += buffer; - buffer[0] = 0; - (void) fgets(buffer, BUFFER_SIZE, cpipe); + if(!fgets(buffer, BUFFER_SIZE, cpipe)) + { + buffer[0] = 0; + } } retVal = pclose(cpipe); |