diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/jo_lowbat.h | 5 | ||||
-rw-r--r-- | src/jo_main.c | 8 | ||||
-rw-r--r-- | src/jo_main.h | 1 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/jo_lowbat.h b/src/jo_lowbat.h index ddc6679..b39243e 100644 --- a/src/jo_lowbat.h +++ b/src/jo_lowbat.h @@ -13,11 +13,14 @@ #ifndef JO_LOWBAT_H #define JO_LOWBAT_H +#include <inttypes.h> + enum { JO_RET_FINE, JO_RET_RD_FAILED }; -char *jo_f_status(void); + +int8_t jo_f_status(void); #endif diff --git a/src/jo_main.c b/src/jo_main.c index 2d19ab8..e5576b3 100644 --- a/src/jo_main.c +++ b/src/jo_main.c @@ -21,13 +21,11 @@ int main(void) { - char *status; + int8_t status; - if (!(status = jo_f_status())) { + if ((status = jo_f_status()) < 0) { return (JO_RET_RD_FAILED); } - printf("status: %s\n", status); - free(status); - status = NULL; + printf("status: %d\n", status); return (JO_RET_FINE); } diff --git a/src/jo_main.h b/src/jo_main.h index 8feabe9..742f1d9 100644 --- a/src/jo_main.h +++ b/src/jo_main.h @@ -17,5 +17,6 @@ #include <stdio.h> #include <stdlib.h> #include <stddef.h> +#include <inttypes.h> #endif |