From 7bd7a2a7985cb46b7719c6554d27a83681ded0ab Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Thu, 15 Feb 2001 20:10:04 +0000 Subject: [PATCH] cleaned up some code that Andreas thought was ugly. --- lib/omapi/auth.c | 16 +++++++++------- lib/omapi/include/omapi/private.h | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/omapi/auth.c b/lib/omapi/auth.c index 5fe1263b3c..e4af977493 100644 --- a/lib/omapi/auth.c +++ b/lib/omapi/auth.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: auth.c,v 1.17 2001/02/15 19:44:41 bwelling Exp $ */ +/* $Id: auth.c,v 1.18 2001/02/15 20:10:03 bwelling Exp $ */ /* Principal Author: DCL */ @@ -105,12 +105,13 @@ auth_find(const char *name, unsigned int algorithm, auth_t **ap) { isc_result_t -auth_makekey(const char *name, unsigned int algorithm, isc_region_t **key) { +auth_makekey(const char *name, unsigned int algorithm, isc_region_t **keyp) { isc_result_t result; auth_t *auth = NULL; + isc_region_t *key; REQUIRE(name != NULL && algorithm != 0); - REQUIRE(key != NULL && *key == NULL); + REQUIRE(keyp != NULL && *keyp == NULL); RUNTIME_CHECK(isc_once_do(&once, initialize_mutex) == ISC_R_SUCCESS); LOCK(&mutex); @@ -127,13 +128,14 @@ auth_makekey(const char *name, unsigned int algorithm, isc_region_t **key) { return (ISC_R_UNEXPECTED); } - *key = isc_mem_get(omapi_mctx, sizeof(isc_region_t)); - if (*key == NULL) + key = isc_mem_get(omapi_mctx, sizeof(isc_region_t)); + if (key == NULL) result = ISC_R_NOMEMORY; if (result == ISC_R_SUCCESS) { - (*key)->base = auth->secret; - (*key)->length = auth->secretlen; + key->base = auth->secret; + key->length = auth->secretlen; + *keyp = key; } } diff --git a/lib/omapi/include/omapi/private.h b/lib/omapi/include/omapi/private.h index 9b3a4c0ebf..0fdba5d70a 100644 --- a/lib/omapi/include/omapi/private.h +++ b/lib/omapi/include/omapi/private.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: private.h,v 1.27 2001/02/15 19:44:46 bwelling Exp $ */ +/* $Id: private.h,v 1.28 2001/02/15 20:10:04 bwelling Exp $ */ /***** ***** Private master include file for the OMAPI library. @@ -307,7 +307,7 @@ auth_destroy(void); #define auth_makekey omapi__auth_makekey isc_result_t -auth_makekey(const char *name, unsigned int algorithm, isc_region_t **key); +auth_makekey(const char *name, unsigned int algorithm, isc_region_t **keyp); /* * Private library functions defined in connection.c.