From a865f91f48f71fd4eca6d3f05158b660231a20e7 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 14 Dec 2016 15:08:36 +0100 Subject: [PATCH] Quick fix for tsig creds const consequences Still need to address the warnings given with the bindings. --- examples/ldns-notify.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; -- 2.47.3