From 3ca853944fcfaad16e603ac19fa45efc0094a24a Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sun, 19 May 2013 10:36:16 +0000 Subject: [PATCH] parse fractions and use absolute difference in calculation --- fs20pcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs20pcs.c b/fs20pcs.c index 3f64a41..431004f 100644 --- a/fs20pcs.c +++ b/fs20pcs.c @@ -322,7 +322,7 @@ int parse_extension(char *ext) uint8_t low = 0; uint8_t i; - t = strtoul(ext, &ep, 10); + t = strtod(ext, &ep); if ((*ep != 's') && (*ep != 'S')) { fprintf(stderr, "Not a valid time in seconds: %s\n", ext); return -1; @@ -358,7 +358,7 @@ int parse_extension(char *ext) if (i_l > 12) i_l = 12; - d = l - i_l; + d = fabs(l - i_l); #ifdef DEBUG printf("d: %f\n", d); -- 2.39.2