fix tag name limit

This commit is contained in:
fengzero
2022-11-10 10:15:40 +00:00
parent 037511d383
commit 64d5407c05
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -20,7 +20,7 @@
#ifndef _NEU_DEFINE_H_
#define _NEU_DEFINE_H_
#define NEU_TAG_NAME_LEN 32
#define NEU_TAG_NAME_LEN 48
#define NEU_TAG_ADDRESS_LEN 128
#define NEU_TAG_DESCRIPTION_LEN 128
#define NEU_GROUP_NAME_LEN 32
+2 -2
View File
@@ -560,7 +560,7 @@ int neu_adapter_driver_add_tag(neu_adapter_driver_t *driver, const char *group,
int ret = NEU_ERR_SUCCESS;
group_t *find = NULL;
if (strlen(tag->name) > NEU_TAG_NAME_LEN) {
if (strlen(tag->name) >= NEU_TAG_NAME_LEN) {
return NEU_ERR_TAG_NAME_TOO_LONG;
}
@@ -632,7 +632,7 @@ int neu_adapter_driver_update_tag(neu_adapter_driver_t *driver,
int ret = NEU_ERR_SUCCESS;
group_t *find = NULL;
if (strlen(tag->name) > NEU_TAG_NAME_LEN) {
if (strlen(tag->name) >= NEU_TAG_NAME_LEN) {
return NEU_ERR_TAG_NAME_TOO_LONG;
}