From: Philippe Proulx Date: Tue, 16 May 2017 04:09:06 +0000 (-0400) Subject: lib/ctf-ir/utils.c: add logging X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=1dc9dd8213f747cad3c6fe04babbce2930c1bec1;p=deliverable%2Fbabeltrace.git lib/ctf-ir/utils.c: add logging Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/lib/ctf-ir/utils.c b/lib/ctf-ir/utils.c index c83b50d99..0ab0df246 100644 --- a/lib/ctf-ir/utils.c +++ b/lib/ctf-ir/utils.c @@ -26,6 +26,9 @@ * SOFTWARE. */ +#define BT_LOG_TAG "CTF-IR-UTILS" +#include + #include #include #include @@ -79,13 +82,20 @@ int bt_ctf_validate_identifier(const char *input_string) char *string = NULL; char *save_ptr, *token; - if (!input_string || input_string[0] == '\0') { + if (!input_string) { + BT_LOGV_STR("Invalid parameter: input string is NULL."); + ret = -1; + goto end; + } + + if (input_string[0] == '\0') { ret = -1; goto end; } string = strdup(input_string); if (!string) { + BT_LOGE("strdup() failed."); ret = -1; goto end; }