mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-02-26 19:56:39 +00:00
falling back to POSIX compatible commands, fgets in stead of getline. MacOSX / BSD doesn't come with glibc on default
This commit is contained in:
@@ -107,10 +107,11 @@ int main(int argc, const char* argv[])
|
||||
size_t n;
|
||||
int s;
|
||||
if (input != NULL) {
|
||||
s = getline(&cmd, &n, input);
|
||||
fgets(cmd, n, input);
|
||||
} else {
|
||||
s = getline(&cmd, &n, stdin);
|
||||
fgets(cmd, n, stdin);
|
||||
}
|
||||
s = strlen(cmd);
|
||||
if (s <= 0) {
|
||||
printf("Bye!\n");
|
||||
free(cmd);
|
||||
|
||||
Reference in New Issue
Block a user