From 0a2cf8aa470a8b67d91b2e580ac3cb607f5989ee Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Fri, 3 May 2024 14:30:08 +0200 Subject: [PATCH] drivers/gamatronic.c: report a response buffer overflow (should not happen though) [#2427] Signed-off-by: Jim Klimov --- drivers/gamatronic.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gamatronic.c b/drivers/gamatronic.c index fff6568836..fd70f98a2a 100644 --- a/drivers/gamatronic.c +++ b/drivers/gamatronic.c @@ -80,6 +80,9 @@ static int sec_upsrecv (char *buf) lenbuf[3] = '\0'; ret = atoi(lenbuf); if (ret > GAMATRONIC_BUF_LEN) { + upslogx(1, "%s: got a longer response from " + "ser_get_line() than expected: %d > %d", + __func__, ret, GAMATRONIC_BUF_LEN); ret = GAMATRONIC_BUF_LEN; } if (ret > 0) {