1. Removal of Null dereferences.
2. Adding field width specifiers.
3. removing negative checks on unsigned int.
Change-Id: I086c57f3a2473895cd424856f1e9e71af89e10d1
Signed-off-by: abitha.s <abitha.s@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21515
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit
17afad03deea12a1d61e1bdc758514313109e61e)
Reviewed-on: https://gerrit.iotivity.org/gerrit/21527
while (iter)
{
following = iter->next;
- if (iter)
- {
- NSOICFree(iter->topicName);
- iter->next = NULL;
- NSOICFree(iter);
- }
+ NSOICFree(iter->topicName);
+ iter->next = NULL;
+ NSOICFree(iter);
iter = following;
}
}
while (iter)\r
{\r
following = iter->next;\r
- if (iter)\r
- {\r
- NSOICFree(iter->topicName);\r
- iter->next = NULL;\r
- NSOICFree(iter);\r
- }\r
+ NSOICFree(iter->topicName);\r
+ iter->next = NULL;\r
+ NSOICFree(iter);\r
iter = following;\r
}\r
}\r
printf("Input: ");
- if(scanf("%d", &num) == EOF)
+ if(scanf("%2d", &num) == EOF)
{
printf("Fail to input num\n");
}
printf("input : ");
- if(scanf("%d", &num) > 0)
+ if(scanf("%2d", &num) > 0)
{
if(scanf("%c", &dummy) > 0)
{
(obj->consumerId)[0] = '\0';
OICFree(obj);
- obj = NULL;
return NS_OK;
}
{
address = schema + 2;
}
- size_t prefixLen = schema - inputaddress;
+ int prefixLen = schema - inputaddress;
if (prefixLen <= 0)
{
NS_LOG(ERROR, "Invalid Input address.");
NSMQServerInfo * serverInfo = NSGetMQServerInfo();
- if (!serverInfo)
+ if (serverInfo)
{
NS_LOG(DEBUG, "serverInfo is not NULL");
NS_LOG_V(DEBUG, "serverInfo->serverUri = %s", serverInfo->serverUri);