[CodeClean] validate str param sandbox/sangjung/tizen_8_backup accepted/tizen/8.0/unified/20231005.095249 accepted/tizen/unified/20230915.160553 tizen_8.0_m2_release
authorJaeyun Jung <jy1210.jung@samsung.com>
Fri, 15 Sep 2023 04:55:09 +0000 (13:55 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Fri, 15 Sep 2023 06:30:38 +0000 (15:30 +0900)
Code clean, macro to check input param.

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
src/libnnstreamer-edge/nnstreamer-edge-aitt.c

index 7ba4598bd0419d8393ed98098e723ca8829f68e3..1e531a9729ade120438a0d7c2f2740e1a70befda 100644 (file)
@@ -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.
  */