mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-15 20:13:46 +00:00
pn53x-tamashell: fix bug introduced by r878
This commit is contained in:
@@ -101,18 +101,17 @@ int main(int argc, const char* argv[])
|
|||||||
add_history(cmd);
|
add_history(cmd);
|
||||||
} else {
|
} else {
|
||||||
#endif //HAVE_READLINE
|
#endif //HAVE_READLINE
|
||||||
cmd = NULL;
|
size_t n = 255;
|
||||||
|
char * ret = NULL;
|
||||||
|
cmd = malloc(n);
|
||||||
printf("%s", prompt);
|
printf("%s", prompt);
|
||||||
fflush(0);
|
fflush(0);
|
||||||
size_t n;
|
|
||||||
int s;
|
|
||||||
if (input != NULL) {
|
if (input != NULL) {
|
||||||
fgets(cmd, n, input);
|
ret = fgets(cmd, n, input);
|
||||||
} else {
|
} else {
|
||||||
fgets(cmd, n, stdin);
|
ret = fgets(cmd, n, stdin);
|
||||||
}
|
}
|
||||||
s = strlen(cmd);
|
if (ret == NULL || strlen(cmd) <= 0) {
|
||||||
if (s <= 0) {
|
|
||||||
printf("Bye!\n");
|
printf("Bye!\n");
|
||||||
free(cmd);
|
free(cmd);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user