From: Willem Toorop Date: Wed, 14 Dec 2016 14:08:36 +0000 (+0100) Subject: Quick fix for tsig creds const consequences X-Git-Tag: release-1.7.0~2^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a865f91f48f71fd4eca6d3f05158b660231a20e7;p=thirdparty%2Fldns.git Quick fix for tsig creds const consequences Still need to address the warnings given with the bindings. --- diff --git a/examples/ldns-notify.c b/examples/ldns-notify.c index 12f7da44..ee8d8174 100644 --- a/examples/ldns-notify.c +++ b/examples/ldns-notify.c @@ -182,6 +182,7 @@ main(int argc, char **argv) uint8_t *wire = NULL; size_t wiresize = 0; const char *port = "53"; + char *keydata; srandom(time(NULL) ^ getpid()); @@ -203,14 +204,14 @@ main(int argc, char **argv) case 'y': tsig_cred.algorithm = (char*)"hmac-md5.sig-alg.reg.int."; tsig_cred.keyname = optarg; - tsig_cred.keydata = strchr(optarg, ':'); - if (tsig_cred.keydata == NULL) { + keydata = strchr(optarg, ':'); + if (keydata == NULL) { printf("TSIG argument is not in form " "key:data: %s\n", optarg); exit(1); } - *tsig_cred.keydata = '\0'; - tsig_cred.keydata++; + *keydata++ = '\0'; + tsig_cred.keydata = keydata; printf("Sign with %s : %s\n", tsig_cred.keyname, tsig_cred.keydata); break;