2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 08:05:21 +00:00

Replace usage of strsep with POSIX strtok_r()

This commit is contained in:
Ondřej Surý
2018-03-21 21:08:29 +00:00
parent b9552250cb
commit 921d05ddcf
17 changed files with 109 additions and 330 deletions

View File

@@ -943,18 +943,6 @@ cleanup:
return (result);
}
static char *
next_token(char **stringp, const char *delim) {
char *res;
do {
res = strsep(stringp, delim);
if (res == NULL)
break;
} while (*res == '\0');
return (res);
}
static isc_result_t
parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
const char *desc) {
@@ -974,23 +962,21 @@ parse_uint(isc_uint32_t *uip, const char *value, isc_uint32_t max,
static void
plus_option(char *option) {
isc_result_t result;
char option_store[256];
char *cmd, *value, *ptr;
char *cmd, *value, *last;
isc_boolean_t state = ISC_TRUE;
strlcpy(option_store, option, sizeof(option_store));
ptr = option_store;
cmd = next_token(&ptr,"=");
cmd = strtok_r(option, "=", &last);
if (cmd == NULL) {
printf(";; Invalid option %s\n", option_store);
printf(";; Invalid option %s\n", option);
return;
}
value = ptr;
if (strncasecmp(cmd, "no", 2)==0) {
cmd += 2;
state = ISC_FALSE;
}
value = strtok_r(NULL, "\0", &last);
#define FULLCHECK(A) \
do { \
size_t _l = strlen(cmd); \

View File

@@ -729,28 +729,25 @@ printgreeting(int argc, char **argv, dig_lookup_t *lookup) {
*/
static void
plus_option(const char *option, isc_boolean_t is_batchfile,
plus_option(char *option, isc_boolean_t is_batchfile,
dig_lookup_t *lookup)
{
isc_result_t result;
char option_store[256];
char *cmd, *value, *ptr, *code;
char *cmd, *value, *last, *code;
isc_uint32_t num;
isc_boolean_t state = ISC_TRUE;
size_t n;
strlcpy(option_store, option, sizeof(option_store));
ptr = option_store;
cmd = next_token(&ptr, "=");
if (cmd == NULL) {
printf(";; Invalid option %s\n", option_store);
if ((cmd = strtok_r(option, "=", &last)) == NULL) {
printf(";; Invalid option %s\n", option);
return;
}
value = ptr;
if (strncasecmp(cmd, "no", 2)==0) {
cmd += 2;
state = ISC_FALSE;
}
/* parse the rest of the string */
value = strtok_r(NULL, "", &last);
#define FULLCHECK(A) \
do { \
@@ -1006,8 +1003,10 @@ plus_option(const char *option, isc_boolean_t is_batchfile,
"specified");
goto exit_or_usage;
}
code = next_token(&value, ":");
save_opt(lookup, code, value);
char *extra;
code = strtok_r(value, ":", &last);
extra = strtok_r(NULL, "\0", &last);
save_opt(lookup, code, extra);
break;
default:
goto invalid_option;
@@ -1524,7 +1523,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
isc_boolean_t config_only, int argc, char **argv,
isc_boolean_t *firstarg)
{
char opt, *value, *ptr, *ptr2, *ptr3;
char opt, *value, *ptr, *ptr2, *ptr3, *last;
isc_result_t result;
isc_boolean_t value_from_next;
isc_textregion_t tr;
@@ -1738,15 +1737,13 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
value);
return (value_from_next);
case 'y':
ptr = next_token(&value, ":"); /* hmac type or name */
if (ptr == NULL) {
if ((ptr = strtok_r(value, ":", &last)) == NULL) {
usage();
}
ptr2 = next_token(&value, ":"); /* name or secret */
if (ptr2 == NULL)
if ((ptr2 = strtok_r(NULL, ":", &last)) == NULL) { /* name or secret */
usage();
ptr3 = next_token(&value, ":"); /* secret or NULL */
if (ptr3 != NULL) {
}
if ((ptr3 = strtok_r(NULL, ":", &last)) != NULL) { /* secret or NULL */
parse_hmac(ptr);
ptr = ptr2;
ptr2 = ptr3;
@@ -1758,6 +1755,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup,
#endif
digestbits = 0;
}
/* XXXONDREJ: FIXME */
strlcpy(keynametext, ptr, sizeof(keynametext));
strlcpy(keysecret, ptr2, sizeof(keysecret));
return (value_from_next);
@@ -1859,10 +1857,9 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
char **rv;
#ifndef NOPOSIX
char *homedir;
char rcfile[256];
char rcfile[PATH_MAX];
#endif
char *input;
int i;
char *last;
isc_boolean_t need_clone = ISC_TRUE;
/*
@@ -1892,32 +1889,23 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
homedir = getenv("HOME");
if (homedir != NULL) {
unsigned int n;
n = snprintf(rcfile, sizeof(rcfile), "%s/.digrc",
homedir);
if (n < sizeof(rcfile))
n = snprintf(rcfile, sizeof(rcfile), "%s/.digrc", homedir);
if (n < sizeof(rcfile)) {
batchfp = fopen(rcfile, "r");
}
if (batchfp != NULL) {
while (fgets(batchline, sizeof(batchline),
batchfp) != 0) {
debug("config line %s", batchline);
bargc = 1;
input = batchline;
bargv[bargc] = next_token(&input, " \t\r\n");
while ((bargc < 62) && (bargv[bargc] != NULL)) {
bargc++;
bargv[bargc] =
next_token(&input, " \t\r\n");
}
if (batchfp != NULL) {
while (fgets(batchline, sizeof(batchline), batchfp) != 0) {
debug("config line %s", batchline);
for (bargc = 1, bargv[bargc] = strtok_r(batchline, " \t\r\n", &last);
bargc < 62 && bargv[bargc];
bargv[++bargc] = strtok_r(NULL, " \t\r\n", &last))
{
debug(".digrc argv %d: %s", bargc, bargv[bargc]);
}
bargv[0] = argv[0];
argv0 = argv[0];
for(i = 0; i < bargc; i++)
debug(".digrc argv %d: %s",
i, bargv[i]);
parse_args(ISC_TRUE, ISC_TRUE, bargc,
(char **)bargv);
parse_args(ISC_TRUE, ISC_TRUE, bargc, (char **)bargv);
}
fclose(batchfp);
}
@@ -1928,8 +1916,9 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
/* Processing '-f batchfile'. */
lookup = clone_lookup(default_lookup, ISC_TRUE);
need_clone = ISC_FALSE;
} else
} else {
lookup = default_lookup;
}
rc = argc;
rv = argv;
@@ -2101,18 +2090,15 @@ parse_args(isc_boolean_t is_batchfile, isc_boolean_t config_only,
if (batchline[0] == '\r' || batchline[0] == '\n'
|| batchline[0] == '#' || batchline[0] == ';')
goto next_line;
input = batchline;
bargv[bargc] = next_token(&input, " \t\r\n");
while ((bargc < 14) && (bargv[bargc] != NULL)) {
bargc++;
bargv[bargc] = next_token(&input, " \t\r\n");
for (bargc = 1, bargv[bargc] = strtok_r(batchline, " \t\r\n", &last);
(bargc < 14) && bargv[bargc];
bargc++, bargv[bargc] = strtok_r(NULL, " \t\r\n", &last)) {
debug("batch argv %d: %s", bargc, bargv[bargc]);
}
bargv[0] = argv[0];
argv0 = argv[0];
for(i = 0; i < bargc; i++)
debug("batch argv %d: %s", i, bargv[i]);
parse_args(ISC_TRUE, ISC_FALSE, bargc, (char **)bargv);
return;
}
@@ -2151,8 +2137,6 @@ query_finished(void) {
char batchline[MXNAME];
int bargc;
char *bargv[16];
char *input;
int i;
if (batchname == NULL) {
isc_app_shutdown();
@@ -2169,19 +2153,17 @@ query_finished(void) {
}
if (fgets(batchline, sizeof(batchline), batchfp) != 0) {
char *last;
debug("batch line %s", batchline);
bargc = 1;
input = batchline;
bargv[bargc] = next_token(&input, " \t\r\n");
while ((bargc < 14) && (bargv[bargc] != NULL)) {
bargc++;
bargv[bargc] = next_token(&input, " \t\r\n");
for (bargc = 1, bargv[bargc] = strtok_r(batchline, " \t\r\n", &last);
bargc < 14 && bargv[bargc];
bargc++, bargv[bargc] = strtok_r(NULL, " \t\r\n", &last))
{
debug("batch argv %d: %s", bargc, bargv[bargc]);
}
bargv[0] = argv0;
for(i = 0; i < bargc; i++)
debug("batch argv %d: %s", i, bargv[i]);
parse_args(ISC_TRUE, ISC_FALSE, bargc, (char **)bargv);
start_lookup();
} else {

View File

@@ -242,18 +242,6 @@ check_next_lookup(dig_lookup_t *lookup);
static isc_boolean_t
next_origin(dig_lookup_t *oldlookup);
char *
next_token(char **stringp, const char *delim) {
char *res;
do {
res = strsep(stringp, delim);
if (res == NULL)
break;
} while (*res == '\0');
return (res);
}
static int
count_dots(char *string) {
char *s;

View File

@@ -369,9 +369,6 @@ destroy_libs(void);
void
set_search_domain(char *domain);
char *
next_token(char **stringp, const char *delim);
/*
* Routines to be defined in dig.c, host.c, and nslookup.c. and
* then assigned to the appropriate function pointer

View File

@@ -813,12 +813,12 @@ addlookup(char *opt) {
static void
do_next_command(char *input) {
char *ptr, *arg;
char *ptr, *arg, *last;
ptr = next_token(&input, " \t\r\n");
if (ptr == NULL)
if ((ptr = strtok_r(input, " \t\r\n", &last)) == NULL) {
return;
arg = next_token(&input, " \t\r\n");
}
arg = strtok_r(NULL, " \t\r\n", &last);
if ((strcasecmp(ptr, "set") == 0) &&
(arg != NULL))
setoption(arg);

View File

@@ -1003,36 +1003,24 @@ named_os_gethostname(char *buf, size_t len) {
return ((n == 0) ? ISC_R_SUCCESS : ISC_R_FAILURE);
}
static char *
next_token(char **stringp, const char *delim) {
char *res;
do {
res = strsep(stringp, delim);
if (res == NULL)
break;
} while (*res == '\0');
return (res);
}
void
named_os_shutdownmsg(char *command, isc_buffer_t *text) {
char *input, *ptr;
char *last, *ptr;
pid_t pid;
input = command;
/* Skip the command name. */
ptr = next_token(&input, " \t");
if (ptr == NULL)
if ((ptr = strtok_r(command, " \t", &last)) == NULL) {
return;
}
ptr = next_token(&input, " \t");
if (ptr == NULL)
if ((ptr = strtok_r(NULL, " \t", &last)) == NULL) {
return;
}
if (strcmp(ptr, "-p") != 0)
if (strcmp(ptr, "-p") != 0) {
return;
}
#ifdef HAVE_LINUXTHREADS
pid = mainpid;

View File

@@ -795,18 +795,6 @@ help(void) {
stdout);
}
static char *
next_token(char **stringp, const char *delim) {
char *res;
do {
res = strsep(stringp, delim);
if (res == NULL)
break;
} while (*res == '\0');
return (res);
}
ISC_PLATFORM_NORETURN_PRE static void
fatal(const char *format, ...)
ISC_FORMAT_PRINTF(1, 2) ISC_PLATFORM_NORETURN_POST;
@@ -1037,24 +1025,21 @@ static void
plus_option(char *option, struct query *query, isc_boolean_t global)
{
isc_result_t result;
char option_store[256];
char *cmd, *value, *ptr, *code;
char *cmd, *value, *last, *code;
isc_uint32_t num;
isc_boolean_t state = ISC_TRUE;
size_t n;
strlcpy(option_store, option, sizeof(option_store));
ptr = option_store;
cmd = next_token(&ptr, "=");
if (cmd == NULL) {
printf(";; Invalid option %s\n", option_store);
if ((cmd = strtok_r(option, "=", &last)) == NULL) {
printf(";; Invalid option %s\n", option);
return;
}
value = ptr;
if (strncasecmp(cmd, "no", 2) == 0) {
cmd += 2;
state = ISC_FALSE;
}
/* parse the rest of the string */
value = strtok_r(NULL, "", &last);
#define FULLCHECK(A) \
do { \
@@ -1279,7 +1264,7 @@ plus_option(char *option, struct query *query, isc_boolean_t global)
fatal("ednsopt no "
"code point "
"specified");
code = next_token(&value, ":");
code = strtok_r(value, ":", &last);
save_opt(query, code, value);
break;
default:
@@ -1755,7 +1740,6 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv)
char *bargv[64];
int rc;
char **rv;
char *input;
isc_boolean_t global = ISC_TRUE;
/*
@@ -1868,15 +1852,15 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv)
fatal("couldn't open batch file '%s'", batchname);
}
while (fgets(batchline, sizeof(batchline), batchfp) != 0) {
bargc = 1;
char *last;
if (batchline[0] == '\r' || batchline[0] == '\n'
|| batchline[0] == '#' || batchline[0] == ';')
continue;
input = batchline;
bargv[bargc] = next_token(&input, " \t\r\n");
while ((bargc < 14) && (bargv[bargc] != NULL)) {
bargc++;
bargv[bargc] = next_token(&input, " \t\r\n");
for (bargc = 1, bargv[bargc] = strtok_r(batchline, " \t\r\n", &last);
(bargc < 14) && bargv[bargc];
bargc++, bargv[bargc] = strtok_r(NULL, " \t\r\n", &last))
{
/* empty body */
}
bargv[0] = argv[0];

31
configure vendored
View File

@@ -747,7 +747,6 @@ ISC_PLATFORM_NEEDSTRLCPY
GENRANDOMLIB
ISC_PLATFORM_NEEDSTRTOUL
ISC_PLATFORM_NEEDMEMMOVE
ISC_PLATFORM_NEEDSTRSEP
ISC_IRS_GETNAMEINFOSOCKLEN
ISC_IRS_NEEDADDRINFO
ISC_PLATFORM_HAVETFO
@@ -19429,36 +19428,6 @@ esac
# Check for some other useful functions that are not ever-present.
#
# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
# reportedly defines strsep() without declaring it in <string.h> when
# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
# AC_CHECK_FUNC() incorrectly succeeds because it declares
# the function itself.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for correctly declared strsep()" >&5
$as_echo_n "checking for correctly declared strsep()... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <string.h>
int
main ()
{
char *sp; char *foo = strsep(&sp, ".");
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }; ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove"
if test "x$ac_cv_func_memmove" = xyes; then :
ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"

View File

@@ -3492,18 +3492,6 @@ esac
# Check for some other useful functions that are not ever-present.
#
# We test for strsep() using AC_TRY_LINK instead of AC_CHECK_FUNC
# because AIX 4.3.3 with patches for bos.adt.include to version 4.3.3.77
# reportedly defines strsep() without declaring it in <string.h> when
# -D_LINUX_SOURCE_COMPAT is not defined [RT #2190], and
# AC_CHECK_FUNC() incorrectly succeeds because it declares
# the function itself.
AC_MSG_CHECKING(for correctly declared strsep())
AC_TRY_LINK([#include <string.h>], [char *sp; char *foo = strsep(&sp, ".");],
[AC_MSG_RESULT(yes); ISC_PLATFORM_NEEDSTRSEP="#undef ISC_PLATFORM_NEEDSTRSEP"],
[AC_MSG_RESULT(no); ISC_PLATFORM_NEEDSTRSEP="#define ISC_PLATFORM_NEEDSTRSEP 1"])
AC_SUBST(ISC_PLATFORM_NEEDSTRSEP)
AC_CHECK_FUNC(memmove,
[ISC_PLATFORM_NEEDMEMMOVE="#undef ISC_PLATFORM_NEEDMEMMOVE"],
[ISC_PLATFORM_NEEDMEMMOVE="#define ISC_PLATFORM_NEEDMEMMOVE 1"])

View File

@@ -286,47 +286,24 @@ quit(1);
int
getzone(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey) {
char *tmp;
char *left;
char *right;
int result=0;
char *token, *last;
UNUSED(dbp);
UNUSED(pkey);
/* Allocate memory to use in parsing the string */
tmp = right = malloc(pdata->size + 1);
/* verify memory was allocated */
if (right == NULL) {
result = BDBparseErr;
goto getzone_cleanup;
if ((token = strtok_r(pdata->data, " ", &last)) == NULL) {
return BDBparseErr;
}
/* copy data string into newly allocated memory */
strncpy(right, pdata->data, pdata->size);
right[pdata->size] = '\0';
/* split string at the first space */
left = isc_string_separate(&right, " ");
/* copy string for "zone" secondary index */
skey->data = strdup(left);
if (skey->data == NULL) {
result = BDBparseErr;
goto getzone_cleanup;
if ((skey->data = strdup(token)) == NULL) {
return BDBparseErr;
}
/* set required values for BDB */
skey->size = strlen(skey->data);
skey->flags = DB_DBT_APPMALLOC;
getzone_cleanup:
/* cleanup memory */
if (tmp != NULL)
free(tmp);
return result;
return 0;
}
/*%
@@ -335,56 +312,30 @@ getzone(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey) {
int
gethost(DB *dbp, const DBT *pkey, const DBT *pdata, DBT *skey) {
char *tmp;
char *left;
char *right;
int result=0;
char *token, *last;
UNUSED(dbp);
UNUSED(pkey);
/* allocate memory to use in parsing the string */
tmp = right = malloc(pdata->size + 1);
/* verify memory was allocated */
if (tmp == NULL) {
result = BDBparseErr;
goto gethost_cleanup;
}
/* copy data string into newly allocated memory */
strncpy(right, pdata->data, pdata->size);
right[pdata->size] = '\0';
/* we don't care about left string. */
/* memory of left string will be freed when tmp is freed. */
isc_string_separate(&right, " ");
/* verify right still has some characters left */
if (right == NULL) {
result = BDBparseErr;
goto gethost_cleanup;
/* we don't care about first token. */
if ((token = strtok_r(right, " ", &last)) == NULL) {
return BDBparseErr;
}
/* get "host" from data string */
left = isc_string_separate(&right, " ");
if ((token = strtok_r(NULL, " ", &last)) == NULL) {
return BDBparseErr;
}
/* copy string for "host" secondary index */
skey->data = strdup(left);
if (skey->data == NULL) {
result = BDBparseErr;
goto gethost_cleanup;
if ((skey->data = strdup(token)) == NULL) {
return BDBparseErr;
}
/* set required values for BDB */
skey->size = strlen(skey->data);
skey->flags = DB_DBT_APPMALLOC;
gethost_cleanup:
/* cleanup memory */
if (tmp != NULL)
free(tmp);
return result;
return 0;
}
/*%

View File

@@ -158,9 +158,9 @@ build_querylist(isc_mem_t *mctx, const char *query_str, char **zone,
* split string at the first "$". set query segment to
* left portion
*/
char *last = NULL;
tseg->sql = isc_mem_strdup(mctx,
isc_string_separate(&right_str,
"$"));
strtok_r(right_str, "$", &last));
if (tseg->sql == NULL) {
/* no memory, clean everything up. */
result = ISC_R_NOMEMORY;

View File

@@ -132,14 +132,16 @@ build_querylist(const char *query_str, char **zone, char **record,
}
/* loop through the string and chop it up */
while (right_str != NULL) {
for (token = strtok_r(right_str, "$", &temp_str);
token;
token = strtok_r(NULL, "$", &temp_str))
{
/* allocate memory for tseg */
tseg = calloc(1, sizeof(query_segment_t));
if (tseg == NULL) { /* no memory, clean everything up. */
result = ISC_R_NOMEMORY;
goto cleanup;
}
tseg->cmd = NULL;
tseg->direct = ISC_FALSE;
/* initialize the query segment link */
DLZ_LINK_INIT(tseg, link);
@@ -150,7 +152,7 @@ build_querylist(const char *query_str, char **zone, char **record,
* split string at the first "$". set query segment to
* left portion
*/
tseg->cmd = strdup(strsep(&right_str, "$"));
tseg->cmd = strdup(token);
if (tseg->cmd == NULL) {
/* no memory, clean everything up. */
result = ISC_R_NOMEMORY;
@@ -203,7 +205,8 @@ build_querylist(const char *query_str, char **zone, char **record,
}
/* we don't need temp_str any more */
free(temp_str);
free(right_str);
right_str = NULL;
/*
* add checks later to verify zone and record are found if
* necessary.
@@ -246,8 +249,9 @@ build_querylist(const char *query_str, char **zone, char **record,
cleanup:
/* get rid of temp_str */
if (temp_str != NULL)
free(temp_str);
if (right_str != NULL) {
free(right_str);
}
flag_fail:
/* get rid of what was build of the query list */

View File

@@ -1051,29 +1051,6 @@ resolve_name(int family, const char *hostname, int flags,
return (error);
}
static char *
irs_strsep(char **stringp, const char *delim) {
char *string = *stringp;
char *s;
const char *d;
char sc, dc;
if (string == NULL)
return (NULL);
for (s = string; *s != '\0'; s++) {
sc = *s;
for (d = delim; (dc = *d) != '\0'; d++)
if (sc == dc) {
*s++ = '\0';
*stringp = s;
return (string);
}
}
*stringp = NULL;
return (string);
}
static void
set_order(int family, int (**net_order)(const char *, int, struct addrinfo **,
int, int))
@@ -1093,19 +1070,21 @@ set_order(int family, int (**net_order)(const char *, int, struct addrinfo **,
} else {
order = getenv("NET_ORDER");
found = 0;
while (order != NULL) {
/*
* We ignore any unknown names.
*/
tok = irs_strsep(&order, ":");
char *last;
for (tok = strtok_r(order, ":", &last);
tok;
tok = strtok_r(NULL, ":", &last))
{
if (strcasecmp(tok, "inet6") == 0) {
if ((found & FOUND_IPV6) == 0)
if ((found & FOUND_IPV6) == 0) {
*net_order++ = add_ipv6;
}
found |= FOUND_IPV6;
} else if (strcasecmp(tok, "inet") == 0 ||
strcasecmp(tok, "inet4") == 0) {
if ((found & FOUND_IPV4) == 0)
if ((found & FOUND_IPV4) == 0) {
*net_order++ = add_ipv4;
}
found |= FOUND_IPV4;
}
}

View File

@@ -183,14 +183,6 @@
*/
@ISC_PLATFORM_QUADFORMAT@
/***
*** String functions.
***/
/*
* If the system needs strsep(), ISC_PLATFORM_NEEDSTRSEP will be defined.
*/
@ISC_PLATFORM_NEEDSTRSEP@
/*
* If the system needs strlcpy(), ISC_PLATFORM_NEEDSTRLCPY will be defined.
*/

View File

@@ -32,13 +32,6 @@
ISC_LANG_BEGINDECLS
char *
isc_string_separate(char **stringp, const char *delim);
#ifdef ISC_PLATFORM_NEEDSTRSEP
#define strsep isc_string_separate
#endif
#ifdef ISC_PLATFORM_NEEDMEMMOVE
#define memmove(a,b,c) bcopy(b,a,c)
#endif

View File

@@ -50,27 +50,6 @@
#include <isc/string.h>
#include <isc/util.h>
char *
isc_string_separate(char **stringp, const char *delim) {
char *string = *stringp;
char *s;
const char *d;
char sc, dc;
if (string == NULL)
return (NULL);
for (s = string; (sc = *s) != '\0'; s++)
for (d = delim; (dc = *d) != '\0'; d++)
if (sc == dc) {
*s++ = '\0';
*stringp = s;
return (string);
}
*stringp = NULL;
return (string);
}
size_t
isc_string_strlcpy(char *dst, const char *src, size_t size)
{

View File

@@ -645,7 +645,6 @@ isc_stdio_sync
isc_stdio_tell
isc_stdio_write
isc_stdtime_get
isc_string_separate
isc_string_strcasestr
isc_string_strlcat
isc_string_strlcpy