summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliuchang <[email protected]>2024-05-23 06:50:10 +0000
committerliuchang <[email protected]>2024-05-23 06:50:10 +0000
commit5d30c1009c4109aaaa918ada4cddb59790867cbd (patch)
tree886e24b67cbe142dd87370202fba5712874a3a07
parent3b5009ce9e008297123d09038a04ba027ff1b4db (diff)
change invoke strtok() to strtok_r()v4.1.38
-rw-r--r--src/maat_ip.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/maat_ip.c b/src/maat_ip.c
index 9fa528f..90a0a54 100644
--- a/src/maat_ip.c
+++ b/src/maat_ip.c
@@ -299,8 +299,9 @@ ip_item_new(struct ip_schema *ip_schema, const char *table_name,
//port range is port or port_start-port_end
if(strchr(port_range,'-')!=NULL){
- char *port_start = strtok(port_range,"-");
- char *port_end = strtok(NULL,"-");
+ char *saveptr = NULL;
+ char *port_start = strtok_r(port_range,"-", &saveptr);
+ char *port_end = strtok_r(NULL,"-", &saveptr);
ip_item->port_start = atoi(port_start);
ip_item->port_end = atoi(port_end);
} else {