From b08fbb7cbf9750de512cd81fd3b864b173688862 Mon Sep 17 00:00:00 2001 From: svdijk Date: Mon, 13 May 2013 18:38:37 +0200 Subject: [PATCH] replace remaining strncat calls with memcpy calls --- src/client/cl_console.c | 4 ++-- src/common/cmdparser.c | 4 ++-- src/common/shared/shared.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/client/cl_console.c b/src/client/cl_console.c index fe11b9d2..0e83d9f9 100644 --- a/src/client/cl_console.c +++ b/src/client/cl_console.c @@ -192,7 +192,7 @@ Con_Dump_f(void) for ( ; l <= con.current; l++) { line = con.text + (l % con.totallines) * con.linewidth; - strncpy(buffer, line, con.linewidth); + memcpy(buffer, line, con.linewidth); for (x = con.linewidth - 1; x >= 0; x--) { @@ -702,7 +702,7 @@ Con_DrawConsole(float frac) if (strlen(text) > i) { y = x - i - 11; - strncpy(dlbar, text, i); + memcpy(dlbar, text, i); dlbar[i] = 0; strcat(dlbar, "..."); } diff --git a/src/common/cmdparser.c b/src/common/cmdparser.c index 6530b7b8..7c4a790d 100644 --- a/src/common/cmdparser.c +++ b/src/common/cmdparser.c @@ -560,8 +560,8 @@ Cmd_MacroExpandString(char *text) return NULL; } - strncpy(temporary, scan, i); - strcpy(temporary + i, token); + memcpy(temporary, scan, i); + memcpy(temporary + i, token, j); strcpy(temporary + i + j, start); strcpy(expanded, temporary); diff --git a/src/common/shared/shared.c b/src/common/shared/shared.c index 7291f780..74616635 100644 --- a/src/common/shared/shared.c +++ b/src/common/shared/shared.c @@ -718,7 +718,7 @@ COM_FileBase(char *in, char *out) else { s--; - strncpy(out, s2 + 1, s - s2); + memcpy(out, s2 + 1, s - s2); out[s - s2] = 0; } } @@ -738,7 +738,7 @@ COM_FilePath(const char *in, char *out) s--; } - strncpy(out, in, s - in); + memcpy(out, in, s - in); out[s - in] = 0; }