lineSize needs to be > 1.
This commit is contained in:
parent
2199757d9b
commit
dd9e4eafbc
@ -85,7 +85,7 @@ static char *getline_prompt(const char *prompt) {
|
|||||||
ssize_t lineSize;
|
ssize_t lineSize;
|
||||||
fprintf( stderr, "%s", prompt );
|
fprintf( stderr, "%s", prompt );
|
||||||
fprintf( stderr, " " );
|
fprintf( stderr, " " );
|
||||||
if ((lineSize = getline( &buf, &bufSize, stdin )) < 0) {
|
if ((lineSize = getline( &buf, &bufSize, stdin )) <= 1) {
|
||||||
free( buf );
|
free( buf );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user