Handle negative time and offset from Epoch
[babeltrace.git] / converter / babeltrace.c
index 0ceca0c40081ec9c4a721a47b59c33b2eb526ec7..326f85686cc6cd5bfab908261e68b24e5128e21b 100644 (file)
@@ -26,8 +26,6 @@
  * SOFTWARE.
  */
 
-#define _GNU_SOURCE
-#include <config.h>
 #include <babeltrace/babeltrace.h>
 #include <babeltrace/format.h>
 #include <babeltrace/context.h>
@@ -351,7 +349,7 @@ static int parse_options(int argc, char **argv)
                                goto end;
                        }
                        errno = 0;
-                       opt_clock_offset = strtoull(str, &endptr, 0);
+                       opt_clock_offset = strtoll(str, &endptr, 0);
                        if (*endptr != '\0' || str == endptr || errno != 0) {
                                fprintf(stderr, "[error] Incorrect --clock-offset argument: %s\n", str);
                                ret = -EINVAL;
@@ -376,7 +374,7 @@ static int parse_options(int argc, char **argv)
                                goto end;
                        }
                        errno = 0;
-                       opt_clock_offset_ns = strtoull(str, &endptr, 0);
+                       opt_clock_offset_ns = strtoll(str, &endptr, 0);
                        if (*endptr != '\0' || str == endptr || errno != 0) {
                                fprintf(stderr, "[error] Incorrect --clock-offset-ns argument: %s\n", str);
                                ret = -EINVAL;
This page took 0.024372 seconds and 4 git commands to generate.