[gnutls-devel] [PATCH 3/6] Small s/memmove/memcpy/ optimization in _gnutls_buffer_append_data().

Jaak Ristioja jaak.ristioja at cyber.ee
Tue Dec 16 17:18:36 CET 2014


Using memcpy in this context seems to be safe as it is also used in the else
branch.
---
 lib/gnutls_str.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/gnutls_str.c b/lib/gnutls_str.c
index ca4eec3..9e36924 100644
--- a/lib/gnutls_str.c
+++ b/lib/gnutls_str.c
@@ -124,7 +124,7 @@ _gnutls_buffer_append_data(gnutls_buffer_st * dest, const void *data,
 
 			dest->data = dest->allocd;
 		}
-		memmove(&dest->data[dest->length], data, data_size);
+		memcpy(&dest->data[dest->length], data, data_size);
 		dest->length = tot_len;
 
 		return tot_len;
-- 
2.2.0




More information about the Gnutls-devel mailing list