parent
6b4097e02b
commit
fe0013a7df
|
@ -96,10 +96,10 @@ static const char *__obj_add_encode(void *pData)
|
|||
}
|
||||
|
||||
if(p->n_items > 0) {
|
||||
int i;
|
||||
cJSON *pArray = cJSON_AddArrayToObject(pRoot, "data");
|
||||
|
||||
if(pArray) {
|
||||
int i;
|
||||
for(i = 0; i < p->n_items; i++) {
|
||||
cJSON *pItem = cJSON_CreateObject();
|
||||
|
||||
|
@ -257,7 +257,7 @@ static int __obj_del_decode(const char *pJsonS, void **pStruct)
|
|||
cJSON *pRoot;
|
||||
PIFACE_DEL_OBJ pData;
|
||||
int arraySize;
|
||||
int i, j;
|
||||
int i;
|
||||
|
||||
*pStruct = malloc(sizeof(IFACE_DEL_OBJ));
|
||||
|
||||
|
|
|
@ -31,14 +31,14 @@ static int split_params(char *pInput, char **pFirst, char **pSecond,
|
|||
{
|
||||
char *pStr = (char *)pInput;
|
||||
char *p;
|
||||
char *pDump;
|
||||
// char *pDump;
|
||||
|
||||
if(!pInput || !pFirst || !pSecond) {
|
||||
LOG_EX(LOG_Error, "Input params error: %p, %p, %p\n", pInput, pFirst, pSecond);
|
||||
return -RET_INPUTERR;
|
||||
}
|
||||
|
||||
pDump = strdup(pInput);
|
||||
//pDump = strdup(pInput);
|
||||
|
||||
p = strsep(&pStr, split);
|
||||
|
||||
|
@ -50,10 +50,10 @@ static int split_params(char *pInput, char **pFirst, char **pSecond,
|
|||
*pSecond = pStr;
|
||||
}
|
||||
|
||||
/* LOG_EX(LOG_Debug, "[%s] Split to First = %s, Second = %s\n", pDump, *pFirst,
|
||||
*pSecond); */
|
||||
// LOG_EX(LOG_Debug, "[%s] Split to First = %s, Second = %s\n", pDump, *pFirst,
|
||||
// *pSecond);
|
||||
|
||||
free(pDump);
|
||||
//free(pDump);
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
|
@ -332,6 +332,8 @@ int object_add(PCMHI_OBJECT pObj, POBJECT_K pObjK)
|
|||
pthread_mutex_lock(&g_obj_lock);
|
||||
HASH_ADD_STR(g_pObject, name, pObj);
|
||||
pthread_mutex_unlock(&g_obj_lock);
|
||||
|
||||
return RET_OK;
|
||||
}
|
||||
|
||||
int object_del(const char *pName)
|
||||
|
@ -731,7 +733,7 @@ static void test_str_time(char *pVal)
|
|||
struct tm tm;
|
||||
char buf[255];
|
||||
|
||||
if(!pVal || strlen(pVal) < 0) {
|
||||
if(!pVal || strlen(pVal) == 0) {
|
||||
LOG_EX(LOG_Error, "Input params error\n");
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue