From c6172b4d9c127b567f15843cb520fdf7f3647fdf Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 28 Apr 2019 16:47:50 +0200 Subject: [PATCH] LoadEML: don't complain on the last \n --- client/loclass/fileutils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/loclass/fileutils.c b/client/loclass/fileutils.c index f01fe93aa..52be1d4b8 100644 --- a/client/loclass/fileutils.c +++ b/client/loclass/fileutils.c @@ -365,6 +365,8 @@ int loadFileEML(const char *preferredName, const char *suffix, void *data, size_ memset(line, 0, sizeof(line)); if (fgets(line, sizeof(line), f) == NULL) { + if (feof(f)) + break; fclose(f); PrintAndLogEx(FAILED, "File reading error."); retval = 2;