Commit 5311a3b7 authored by Ondřej Surý's avatar Ondřej Surý
Browse files

We use too old Visual Compiler to use scoped variables

parent 96a07ba8
......@@ -733,7 +733,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
dig_lookup_t *lookup)
{
isc_result_t result;
char *cmd, *value, *last, *code;
char *cmd, *value, *last, *code, *extra;
isc_uint32_t num;
isc_boolean_t state = ISC_TRUE;
size_t n;
......@@ -1003,7 +1003,6 @@ plus_option(char *option, isc_boolean_t is_batchfile,
"specified");
goto exit_or_usage;
}
char *extra;
code = strtok_r(value, ":", &last);
extra = strtok_r(NULL, "\0", &last);
save_opt(lookup, code, extra);
......@@ -2137,6 +2136,7 @@ query_finished(void) {
char batchline[MXNAME];
int bargc;
char *bargv[16];
char *last;
if (batchname == NULL) {
isc_app_shutdown();
......@@ -2153,7 +2153,6 @@ query_finished(void) {
}
if (fgets(batchline, sizeof(batchline), batchfp) != 0) {
char *last;
debug("batch line %s", batchline);
for (bargc = 1, bargv[bargc] = strtok_r(batchline, " \t\r\n", &last);
bargc < 14 && bargv[bargc];
......
......@@ -470,6 +470,7 @@ parse_command_line(int argc, char *argv[]) {
int ch;
int port;
const char *p;
char *last;
save_command_line(argc, argv);
......@@ -607,7 +608,6 @@ parse_command_line(int argc, char *argv[]) {
else if (!strncmp(isc_commandline_argument,
"mkeytimers=", 11))
{
char *last;
p = strtok_r(isc_commandline_argument + 11, "/", &last);
if (p == NULL)
named_main_earlyfatal("bad mkeytimer");
......
......@@ -1741,6 +1741,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv)
int rc;
char **rv;
isc_boolean_t global = ISC_TRUE;
char *last;
/*
* The semantics for parsing the args is a bit complex; if
......@@ -1852,7 +1853,6 @@ 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) {
char *last;
if (batchline[0] == '\r' || batchline[0] == '\n'
|| batchline[0] == '#' || batchline[0] == ';')
continue;
......
......@@ -108,6 +108,7 @@ build_querylist(isc_mem_t *mctx, const char *query_str, char **zone,
char *right_str = NULL;
query_list_t *tql;
query_segment_t *tseg = NULL;
char *last;
REQUIRE(querylist != NULL && *querylist == NULL);
REQUIRE(mctx != NULL);
......@@ -158,7 +159,7 @@ 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;
last = NULL;
tseg->sql = isc_mem_strdup(mctx,
strtok_r(right_str, "$", &last));
if (tseg->sql == NULL) {
......
......@@ -113,6 +113,7 @@ bdb_lookup(const char *zone, const char *name, void *dbdata,
isc_consttextregion_t ttltext;
DBC *c;
DBT key, data;
char *last;
UNUSED(zone);
#ifdef DNS_CLIENTINFO_VERSION
......@@ -137,7 +138,6 @@ bdb_lookup(const char *zone, const char *name, void *dbdata,
ret = c->c_get(c, &key, &data, DB_SET);
while (ret == 0) {
char *last;
((char *)key.data)[key.size] = 0;
((char *)data.data)[data.size] = 0;
ttltext.base = strtok_r((char *)data.data, " ", &last);
......
......@@ -1055,7 +1055,7 @@ static void
set_order(int family, int (**net_order)(const char *, int, struct addrinfo **,
int, int))
{
char *order, *tok;
char *order, *tok, *last;
int found;
if (family) {
......@@ -1070,7 +1070,6 @@ set_order(int family, int (**net_order)(const char *, int, struct addrinfo **,
} else {
order = getenv("NET_ORDER");
found = 0;
char *last;
for (tok = strtok_r(order, ":", &last);
tok;
tok = strtok_r(NULL, ":", &last))
......
......@@ -59,6 +59,7 @@ is_ntfs(const char * file) {
char *machinename;
char *sharename;
char filename[1024];
char *last;
REQUIRE(filename != NULL);
......@@ -76,7 +77,6 @@ is_ntfs(const char * file) {
/* Copy 'c:\' or 'c:/' and NUL terminate. */
strlcpy(drive, filename, ISC_MIN(3 + 1, sizeof(drive)));
} else if ((filename[0] == '\\') && (filename[1] == '\\')) {
char *last;
/* Find the machine and share name and rebuild the UNC */
strlcpy(tmpbuf, filename, sizeof(tmpbuf));
machinename = strtok_r(tmpbuf, "\\", &last);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment