8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 06:03:02 +01:00

Make sure the interactive gfix answer is correctly processed.

This commit is contained in:
robocop 2009-08-16 08:43:45 +00:00
parent e039672963
commit 1552a125ad

View File

@ -671,11 +671,12 @@ static SINT64 ask()
ALICE_print(85);
// msg 85: Commit, rollback, or neither (c, r, or n)?
int c;
char* p;
for (p = response; (c = getchar()) != '\n' && !feof(stdin) && !ferror(stdin);)
const char* end = response + sizeof(response) - 1;
char* p = response;
while ((c = getchar()) != '\n' && !feof(stdin) && !ferror(stdin) && p < end)
*p++ = c;
if (p == response)
return ~0;
return ~(SINT64(0));
*p = 0;
ALICE_down_case(response, response, sizeof(response));
if (!strcmp(response, "n") || !strcmp(response, "c") || !strcmp(response, "r"))