summaryrefslogtreecommitdiff
path: root/lib/isc/hex.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/isc/hex.c')
-rw-r--r--lib/isc/hex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/isc/hex.c b/lib/isc/hex.c
index 3fa0e699fa553..00903c7374cf8 100644
--- a/lib/isc/hex.c
+++ b/lib/isc/hex.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005, 2007, 2008, 2013, 2014 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -99,7 +99,7 @@ hex_decode_char(hex_decode_ctx_t *ctx, int c) {
if ((s = strchr(hex, toupper(c))) == NULL)
return (ISC_R_BADHEX);
- ctx->val[ctx->digits++] = s - hex;
+ ctx->val[ctx->digits++] = (int)(s - hex);
if (ctx->digits == 2) {
unsigned char num;
@@ -183,7 +183,7 @@ str_totext(const char *source, isc_buffer_t *target) {
if (l > region.length)
return (ISC_R_NOSPACE);
- memcpy(region.base, source, l);
+ memmove(region.base, source, l);
isc_buffer_add(target, l);
return (ISC_R_SUCCESS);
}
@@ -195,7 +195,7 @@ mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
isc_buffer_availableregion(target, &tr);
if (length > tr.length)
return (ISC_R_NOSPACE);
- memcpy(tr.base, base, length);
+ memmove(tr.base, base, length);
isc_buffer_add(target, length);
return (ISC_R_SUCCESS);
}