From 2feda4059fab6e33eb08d169ae8dcbbc43625251 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Fri, 21 Apr 2023 22:44:23 +0200 Subject: [PATCH] Fix issue in case of invalid IO --- m-serial-json.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/m-serial-json.h b/m-serial-json.h index b0636bee..7052b716 100644 --- a/m-serial-json.h +++ b/m-serial-json.h @@ -293,8 +293,9 @@ m_ser1al_json_read_skip (FILE *f) { int c; do { + // c is an int, and is the value of the character read as unsigned char c = fgetc(f); - } while (isspace(c)); + } while (c != EOF && isspace(c)); return c; }