mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
tests/drivers/shtcx: don't repeat last string on error
This commit is contained in:
parent
683041979b
commit
df79422dce
@ -20,6 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "timex.h"
|
#include "timex.h"
|
||||||
#include "ztimer.h"
|
#include "ztimer.h"
|
||||||
@ -51,6 +52,9 @@ int main(void)
|
|||||||
|
|
||||||
len = fmt_s16_dfp(str_hum, hum, -2);
|
len = fmt_s16_dfp(str_hum, hum, -2);
|
||||||
str_hum[len] = '\0';
|
str_hum[len] = '\0';
|
||||||
|
} else {
|
||||||
|
strcpy(str_temp, "ERROR");
|
||||||
|
strcpy(str_hum, "ERROR");
|
||||||
}
|
}
|
||||||
/* print values to STDIO */
|
/* print values to STDIO */
|
||||||
printf("Temperature [°C]: %s\n", str_temp);
|
printf("Temperature [°C]: %s\n", str_temp);
|
||||||
|
Loading…
Reference in New Issue
Block a user