From ae47947fdbd1210ab49ce45c3a01de83a7780604 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Mon, 31 Jan 2000 14:58:11 +0000 Subject: [PATCH] Changed API for omapi_string_totext; the string was not always nul-terminated, so now the function sets a region instead. --- lib/omapi/string.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/omapi/string.c b/lib/omapi/string.c index 6a3d6636dc..a8d396b6b8 100644 --- a/lib/omapi/string.c +++ b/lib/omapi/string.c @@ -15,7 +15,7 @@ * SOFTWARE. */ -/* $Id: string.c,v 1.2 2000/01/28 05:22:02 marka Exp $ */ +/* $Id: string.c,v 1.3 2000/01/31 14:58:11 tale Exp $ */ /* Principal Author: Ted Lemon */ @@ -62,11 +62,12 @@ omapi_string_dereference(omapi_string_t **h) { *h = NULL; } -char * -omapi_string_totext(omapi_string_t *string) { - ENSURE(string->value[string->len] == '\0'); +void +omapi_string_totext(omapi_string_t *string, isc_region_t *region) { + REQUIRE(string != NULL && region != NULL); - return ((char *)string->value); + region->base = string->value; + region->length = string->len; } int