]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
declaring progname as a char pointer in util.c
authorAndreas Gustafsson <source@isc.org>
Wed, 8 Aug 2001 05:13:47 +0000 (05:13 +0000)
committerAndreas Gustafsson <source@isc.org>
Wed, 8 Aug 2001 05:13:47 +0000 (05:13 +0000)
and a char array in rndc-confgen.c doesn't work

bin/rndc/rndc-confgen.c

index e33e915ff8fe4e934a49b358825e5352bc102b57..89b049ec62ab3bf190de7393106af20cb217ccbb 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: rndc-confgen.c,v 1.6 2001/08/03 23:44:49 gson Exp $ */
+/* $Id: rndc-confgen.c,v 1.7 2001/08/08 05:13:47 gson Exp $ */
 
 #include <config.h>
 
@@ -49,7 +49,9 @@
 #define DEFAULT_SERVER         "127.0.0.1"
 #define DEFAULT_PORT           953
 
-char progname[256];
+static char program[256];
+char *progname;
+
 isc_boolean_t verbose = ISC_FALSE;
 
 const char *keyfile, *keydef;
@@ -146,9 +148,10 @@ main(int argc, char **argv) {
 
        keydef = keyfile = RNDC_KEYFILE;
 
-       result = isc_file_progname(*argv, progname, sizeof(progname));
+       result = isc_file_progname(*argv, program, sizeof(program));
        if (result != ISC_R_SUCCESS)
-               memcpy(progname, "rndc-confgen", 13);
+               memcpy(program, "rndc-confgen", 13);
+       progname = program;
 
        keyname = DEFAULT_KEYNAME;
        keysize = DEFAULT_KEYLENGTH;