]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
We use too old Visual Compiler to use scoped variables
authorOndřej Surý <ondrej@sury.org>
Wed, 11 Apr 2018 13:16:34 +0000 (15:16 +0200)
committerOndřej Surý <ondrej@sury.org>
Thu, 12 Apr 2018 08:37:33 +0000 (10:37 +0200)
bin/dig/dig.c
bin/named/main.c
bin/tools/mdig.c
contrib/dlz/drivers/sdlz_helper.c
contrib/sdb/bdb/bdb.c
lib/irs/getaddrinfo.c
lib/isc/win32/fsaccess.c

index dcd11f14fcf99ba25c5f853521bc4d1b0abefb8b..215faa155fcdce977600fe55b5efebfc28efbc0e 100644 (file)
@@ -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];
index 5307b0837830a44124f399da2921b560f1469861..526779befa2c13868e1de3460e14d1ef71d08c7b 100644 (file)
@@ -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");
index e9e0c52ede84c2a68cabfd865b6494a7c1ab7474..6edb96e8e45ac0738d0825ca8e416f63cf23d24f 100644 (file)
@@ -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;
index 46bb61dcb7f19fe9af7b11c9d12472b6b35b6c16..ca79f4ccd6627f8a7e19e52bb648aa7b83014384 100644 (file)
@@ -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) {
index 351bdc8a5407230d3cecb7db658edf387b99c9ef..8d514abb2d465d318c92a2f87521eb1c27ae7fb9 100644 (file)
@@ -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);
index 2aed01c3157254108474149876e05ac0cffc3d77..f3172543f1cd95da3795ae2fa09c48da7dc74d36 100644 (file)
@@ -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))
index 9b3a6559ebe94984f91487e5c7cb709db6c92ca5..916a4b13aff1f0e534504266250fd5b54a087bdc 100644 (file)
@@ -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);