diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-09 13:59:46 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2008-04-09 13:59:46 +0800 |
commit | e8edfbff2de447873e7ba9cf3019dcb689fe4082 (patch) | |
tree | 6acf5cf68401e0918f69c2b0c20217be6f82cca6 | |
parent | 5f4c0ce8c7d09a05b86097ad923bcbd84cc3d9c3 (diff) | |
download | pttbbs-e8edfbff2de447873e7ba9cf3019dcb689fe4082.tar pttbbs-e8edfbff2de447873e7ba9cf3019dcb689fe4082.tar.gz pttbbs-e8edfbff2de447873e7ba9cf3019dcb689fe4082.tar.bz2 pttbbs-e8edfbff2de447873e7ba9cf3019dcb689fe4082.tar.lz pttbbs-e8edfbff2de447873e7ba9cf3019dcb689fe4082.tar.xz pttbbs-e8edfbff2de447873e7ba9cf3019dcb689fe4082.tar.zst pttbbs-e8edfbff2de447873e7ba9cf3019dcb689fe4082.zip |
Use reentrant strtok_r
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4107 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | daemon/fromd/ip_desc_db.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/daemon/fromd/ip_desc_db.c b/daemon/fromd/ip_desc_db.c index 9a399bcb..bd1b85d6 100644 --- a/daemon/fromd/ip_desc_db.c +++ b/daemon/fromd/ip_desc_db.c @@ -20,7 +20,7 @@ int ip_desc_db_reload(const char * cfgfile) { FILE *fp; char buf[256]; - char *ip, *mask; + char *ip, *mask, *strtok_p; db_entry *new_db = NULL; int new_db_len = 0, new_db_size = 0; int result = 0; @@ -33,7 +33,7 @@ int ip_desc_db_reload(const char * cfgfile) if (!buf[0] || buf[0] == '\n') continue; - ip = strtok(buf, " \t\n"); + ip = strtok_r(buf, " \t\n", &strtok_p); if (ip == NULL || *ip == '#' || *ip == '@') continue; @@ -65,7 +65,7 @@ int ip_desc_db_reload(const char * cfgfile) new_db[new_db_len].netmask; // description - if ( (ip = strtok(NULL, " \t\n")) == NULL ) { + if ( (ip = strtok_r(NULL, " \t\n", &strtok_p)) == NULL ) { strcpy(new_db[new_db_len].desc, "¶³²`¤£ª¾³B"); } else { |