From: hyuna0213.jo Date: Wed, 22 Jun 2016 05:09:53 +0000 (+0900) Subject: Fix a wrong conditional statement about token value. X-Git-Tag: 1.2.0+RC1~290 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5699d21bf7c9210577f65f0271e47692f860d5b;p=platform%2Fupstream%2Fiotivity.git Fix a wrong conditional statement about token value. if the first byte of the token is 00, the condition will return false even though the token is valid. Change-Id: I7386cb3644f32e7d1cabb58a1ef8c7162cf19476 Signed-off-by: hyuna0213.jo Reviewed-on: https://gerrit.iotivity.org/gerrit/8831 Reviewed-by: jihwan seo Tested-by: jenkins-iotivity Reviewed-by: Jon A. Cruz --- diff --git a/resource/csdk/stack/src/ocobserve.c b/resource/csdk/stack/src/ocobserve.c index 636572a..0b1d581 100644 --- a/resource/csdk/stack/src/ocobserve.c +++ b/resource/csdk/stack/src/ocobserve.c @@ -376,7 +376,7 @@ OCStackResult AddObserver (const char *resUri, return OC_STACK_RESOURCE_ERROR; } - if (!resUri || !token || !*token) + if (!resUri || !token) { return OC_STACK_INVALID_PARAM; } @@ -446,7 +446,7 @@ ResourceObserver* GetObserverUsingToken (const CAToken_t token, uint8_t tokenLen { ResourceObserver *out = NULL; - if (token && *token) + if (token) { OIC_LOG(INFO, TAG, "Looking for token"); OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength); @@ -472,7 +472,7 @@ ResourceObserver* GetObserverUsingToken (const CAToken_t token, uint8_t tokenLen OCStackResult DeleteObserverUsingToken (CAToken_t token, uint8_t tokenLength) { - if (!token || !*token) + if (!token) { return OC_STACK_INVALID_PARAM; }