From 4e9fe22d9a1a014a9c734776eea921eb22c228e6 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Tue, 11 Dec 2018 21:26:56 +0600 Subject: [PATCH] =?UTF-8?q?select=E5=85=BC=E5=AE=B9=E6=97=A7=E7=9A=84label?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/entry/Maat_command.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/entry/Maat_command.cpp b/src/entry/Maat_command.cpp index 4cc3e5b..4d26bba 100644 --- a/src/entry/Maat_command.cpp +++ b/src/entry/Maat_command.cpp @@ -2441,9 +2441,18 @@ int Maat_cmd_key_select(Maat_feather_t feather, int label_id, struct Maat_cmd_ke { result[i].table_name=_maat_strdup(data_reply->element[i]->str); tmp=strchr(result[i].table_name, ','); - *tmp='\0'; - tmp++; - result[i].rule_id=atoi(tmp); + if(tmp!=NULL) + { + *tmp='\0'; + tmp++; + result[i].rule_id=atoi(tmp); + } + else// old version compatible + { + result[i].rule_id=atoi(result[i].table_name); + free(result[i].table_name); + result[i].table_name=NULL; + } } freeReplyObject(data_reply); *keys=result;