From df79422dce61a9b79df0263bd99fadefe1c7381f Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 2 Aug 2023 15:58:05 +0200 Subject: [PATCH] tests/drivers/shtcx: don't repeat last string on error --- tests/drivers/shtcx/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/drivers/shtcx/main.c b/tests/drivers/shtcx/main.c index 5caddee803..8b603caa23 100644 --- a/tests/drivers/shtcx/main.c +++ b/tests/drivers/shtcx/main.c @@ -20,6 +20,7 @@ */ #include #include +#include #include "timex.h" #include "ztimer.h" @@ -51,6 +52,9 @@ int main(void) len = fmt_s16_dfp(str_hum, hum, -2); str_hum[len] = '\0'; + } else { + strcpy(str_temp, "ERROR"); + strcpy(str_hum, "ERROR"); } /* print values to STDIO */ printf("Temperature [°C]: %s\n", str_temp);