summaryrefslogtreecommitdiffstats
path: root/lib/libalias/alias_proxy.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2000-08-29 21:34:55 +0000
committerache <ache@FreeBSD.org>2000-08-29 21:34:55 +0000
commit58751a777acc4db3f45a313f06ef5808d9c40250 (patch)
treeb0d28cf3e79ac613334e2ede8519a2a849b26994 /lib/libalias/alias_proxy.c
parent59889a1524d53b0efa5deebd003a0c6b5118b513 (diff)
downloadFreeBSD-src-58751a777acc4db3f45a313f06ef5808d9c40250.zip
FreeBSD-src-58751a777acc4db3f45a313f06ef5808d9c40250.tar.gz
strtok -> strsep (no strtok allowed in libraries)
add unsigned char cast to ctype macro
Diffstat (limited to 'lib/libalias/alias_proxy.c')
-rw-r--r--lib/libalias/alias_proxy.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/libalias/alias_proxy.c b/lib/libalias/alias_proxy.c
index 02e1765..08627fa 100644
--- a/lib/libalias/alias_proxy.c
+++ b/lib/libalias/alias_proxy.c
@@ -520,6 +520,7 @@ PacketAliasProxyRule(const char *cmd)
char buffer[256];
char str_port[sizeof(buffer)];
char str_server_port[sizeof(buffer)];
+ char *res = buffer;
int rule_index;
int proto;
@@ -540,7 +541,7 @@ PacketAliasProxyRule(const char *cmd)
/* Convert to lower case */
len = strlen(buffer);
for (i=0; i<len; i++)
- buffer[i] = tolower(buffer[i]);
+ buffer[i] = tolower((unsigned char)buffer[i]);
/* Set default proxy type */
@@ -570,7 +571,7 @@ PacketAliasProxyRule(const char *cmd)
#define STATE_READ_SRC 7
#define STATE_READ_DST 8
state = STATE_READ_KEYWORD;
- token = strtok(buffer, " \t");
+ token = strsep(&res, " \t");
token_count = 0;
while (token != NULL)
{
@@ -739,7 +740,9 @@ PacketAliasProxyRule(const char *cmd)
break;
}
- token = strtok(NULL, " \t");
+ do {
+ token = strsep(&res, " \t");
+ } while (token != NULL && !*token);
}
#undef STATE_READ_KEYWORD
#undef STATE_READ_TYPE
OpenPOWER on IntegriCloud