From 76b33eddedcecd07e26043173c2da5b04c1cb428 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Wed, 15 Mar 2006 06:25:26 +0000
Subject: [PATCH] Use memcpy() rather than str*cpy() since the buffer size is
 known and we don't actually need the terminating NULL.  Still terminate
 prefix though to be nice.

---
 src/sbbs3/js_global.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/sbbs3/js_global.c b/src/sbbs3/js_global.c
index 0f8032b43a..125828b6fb 100644
--- a/src/sbbs3/js_global.c
+++ b/src/sbbs3/js_global.c
@@ -781,7 +781,7 @@ js_word_wrap(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 			/* Terminate prefix */
 			prefix[prefix_bytes]=0;
 		}
-		strncpy(linebuf,prefix,prefix_bytes);
+		memcpy(linebuf,prefix,prefix_bytes);
 		l=prefix_bytes;
 		ocol=prefix_len+1;
 		icol=prefix_len+1;
@@ -827,7 +827,7 @@ js_word_wrap(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 					linebuf[l++]='\r';
 					linebuf[l++]='\n';
 					outbuf_append(&outbuf, &outp, linebuf, l, &outbuf_size);
-					strncpy(linebuf,prefix,prefix_bytes);
+					memcpy(linebuf,prefix,prefix_bytes);
 					l=prefix_bytes;
 					ocol=prefix_len+1;
 					old_prefix_bytes=prefix_bytes;
@@ -848,7 +848,7 @@ js_word_wrap(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
 							linebuf[l++]='\n';
 							outbuf_append(&outbuf, &outp, linebuf, l, &outbuf_size);
 							if(prefix)
-								strcpy(linebuf,prefix);
+								memcpy(linebuf,prefix,prefix_bytes);
 							l=prefix_bytes;
 							ocol=prefix_len+1;
 						}
-- 
GitLab