From ee2bc27bdaf31c47397ac99eeb3526722a21cd64 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 30 Jul 2022 04:38:24 +0200 Subject: [PATCH] Fix issue in serial-bin Note: this is a classic c error, so it may be interresting to discover why the static analysis tools didn't report this error. --- m-serial-bin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m-serial-bin.h b/m-serial-bin.h index e38de0e2..0806c010 100644 --- a/m-serial-bin.h +++ b/m-serial-bin.h @@ -99,7 +99,7 @@ m_ser1al_bin_read_size(FILE *f, size_t *size) return true; } size_t s = 0; - int l = (c = 255) ? 8 : (c == 254) ? 4 : 2; + int l = (c == 255) ? 8 : (c == 254) ? 4 : 2; for(int i = 0; i < l; i++) { c = fgetc(f); if (M_UNLIKELY(c == EOF)) return false;