From 1dc9dd8213f747cad3c6fe04babbce2930c1bec1 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 16 May 2017 00:09:06 -0400 Subject: [PATCH] lib/ctf-ir/utils.c: add logging MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- lib/ctf-ir/utils.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ctf-ir/utils.c b/lib/ctf-ir/utils.c index c83b50d9..0ab0df24 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; } -- 2.34.1