Add bt_common_abort() and use it instead of abort() directly
[babeltrace.git] / src / argpar / argpar.c
index fe78a008a5eebba4c8dc9cae982d64a0b25858c6..7f4e46b3d758332eff529b1396cfb3d4c578e59e 100644 (file)
  * SOFTWARE.
  */
 
+#include <stdbool.h>
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
 
 #include "common/assert.h"
+#include "common/common.h"
 
 #include "argpar.h"
 
@@ -64,7 +66,7 @@ struct bt_argpar_item_opt *create_opt_item(
 
        if (arg) {
                opt_item->arg = g_strdup(arg);
-               if (!opt_item) {
+               if (!opt_item->arg) {
                        goto error;
                }
        }
@@ -422,7 +424,7 @@ struct bt_argpar_parse_ret bt_argpar_parse(unsigned int argc,
                                parse_ret.error, i, orig_arg);
                        goto error;
                default:
-                       abort();
+                       bt_common_abort();
                }
 
                if (used_next_orig_arg) {
This page took 0.024938 seconds and 4 git commands to generate.