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; }