From 2bf50d57f0f8d856ae38cf82b0a0f3746f46a08a Mon Sep 17 00:00:00 2001 From: Jaeyun Jung Date: Fri, 15 Sep 2023 13:55:09 +0900 Subject: [PATCH] [CodeClean] validate str param Code clean, macro to check input param. Signed-off-by: Jaeyun Jung --- src/libnnstreamer-edge/nnstreamer-edge-aitt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libnnstreamer-edge/nnstreamer-edge-aitt.c b/src/libnnstreamer-edge/nnstreamer-edge-aitt.c index 7ba4598..1e531a9 100644 --- a/src/libnnstreamer-edge/nnstreamer-edge-aitt.c +++ b/src/libnnstreamer-edge/nnstreamer-edge-aitt.c @@ -338,13 +338,13 @@ nns_edge_aitt_set_option (nns_edge_aitt_h handle, const char *key, return NNS_EDGE_ERROR_INVALID_PARAMETER; } - if (!key) { + if (!STR_IS_VALID (key)) { nns_edge_loge ("The parameter, 'key' is NULL. It should be a valid const char*"); return NNS_EDGE_ERROR_INVALID_PARAMETER; } - if (!value) { + if (!STR_IS_VALID (value)) { nns_edge_loge ("The parameter, 'value' is NULL. It should be a valid const char*"); return NNS_EDGE_ERROR_INVALID_PARAMETER; @@ -380,7 +380,7 @@ nns_edge_aitt_get_option (nns_edge_aitt_h handle, const char *key) return NULL; } - if (!key) { + if (!STR_IS_VALID (key)) { nns_edge_loge ("The parameter, 'key' is NULL. It should be a valid const char*"); return NULL; @@ -397,7 +397,6 @@ nns_edge_aitt_get_option (nns_edge_aitt_h handle, const char *key) return aitt_option_get (ah->option, aitt_opt); } - /** * @brief Create AITT handle. */ -- 2.34.1