From e8f9daac97f55171661679ea79eb1b6b5fc14784 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Mon, 8 Feb 2021 18:59:07 +1300 Subject: Add basic unit testing for util.c --- util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util.c') diff --git a/util.c b/util.c index bd3f71f..d78809f 100644 --- a/util.c +++ b/util.c @@ -5,13 +5,13 @@ float pressure_to_metres_asl(float real, float setting) { - return 44330.f*(1.f-pow(real/setting, 1/5.255)); + return 44330.f*(1.f-powf(real/setting, 1/5.255)); } void blank_to_eol(char *line, size_t len) { size_t i = 0; - for (i = strlen(line); i < len - 1; i++) { + for (i = strnlen(line, len - 1); i < len - 1; i++) { line[i] = ' '; } line[i] = '\0'; -- cgit v1.1