diff --git a/c_cpp_wrapper/protocol.go b/c_cpp_wrapper/protocol.go index c9aa97e..9b5b065 100644 --- a/c_cpp_wrapper/protocol.go +++ b/c_cpp_wrapper/protocol.go @@ -3,6 +3,7 @@ package main /* #include #include +#include typedef void (*CB_S)(char *); typedef void (*CB_I_S)(int,char *); typedef void (*CB_S_I_S_S)(char *,int,char *,char *); @@ -26,6 +27,9 @@ void Call_CB_I_S(CB_I_S func,int event,char* data) printf("callback func is null\n"); return; } + if (strcmp(data, "\"\"") == 0) { + strcpy(data, ""); + } func(event,data); if (data != NULL && data[0] != '\0') { @@ -39,6 +43,9 @@ void Call_CB_S_I_S_S(CB_S_I_S_S func,char* operationID, int errCode,char* errMsg printf("callback func is null\n"); return; } + if (strcmp(data, "\"\"") == 0) { + strcpy(data, ""); + } func(operationID,errCode,errMsg,data); if (errMsg != NULL && errMsg[0] != '\0') { @@ -62,6 +69,9 @@ void Call_CB_S_I_S_S_I(CB_S_I_S_S_I func,char* operationID,int errCode,char* err printf("callback func is null\n"); return; } + if(strcmp(data, "\"\"") == 0) { + strcpy(data, ""); + } func(operationID,errCode,errMsg,data,progress); if (errMsg != NULL && errMsg[0] != '\0') {