mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
Previously, the first character written to the buffer was random (off the
stack). Not sure why this didn't blow up for others. Make sure we fill one character before placing one in the buffer. svn path=/trunk/; revision=17793
This commit is contained in:
parent
ac5798e0c9
commit
24a13ab689
1 changed files with 5 additions and 2 deletions
|
@ -841,10 +841,13 @@ MingwBackend::GetBinutilsVersion ( const string& binutilsCommand )
|
|||
NUL,
|
||||
NUL );
|
||||
fp = popen ( versionCommand.c_str () , "r" );
|
||||
for( i = 0; ( i < 80 ) && ( feof ( fp ) == 0 ); i++ )
|
||||
for( i = 0;
|
||||
( i < 80 ) &&
|
||||
( feof ( fp ) == 0 &&
|
||||
( ( ch = fgetc( fp ) ) != -1 ) );
|
||||
i++ )
|
||||
{
|
||||
buffer[i] = (char) ch;
|
||||
ch = fgetc( fp );
|
||||
}
|
||||
buffer[i] = '\0';
|
||||
pclose ( fp );
|
||||
|
|
Loading…
Reference in a new issue