From 407a45a3b73a6c776dc47ce69cea5f1611a0f3eb Mon Sep 17 00:00:00 2001 From: "Robin Burchell w00t@inspircd.org" Date: Tue, 30 Sep 2008 18:45:08 +0000 Subject: [PATCH] Merge (with small conflict) from upstream. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1177 5417fbe8-f217-4b02-8779-1006273d7864 --- src/misc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/misc.c b/src/misc.c index 68c470192..d71270fd1 100644 --- a/src/misc.c +++ b/src/misc.c @@ -139,16 +139,16 @@ char *stristr(char *s1, char *s2) * @param s String * @param size size of s * @param old character to replace - * @param new character to replace with + * @param newstr character to replace with * @return updated s */ -char *strnrepl(char *s, int32 size, const char *old, const char *new) +char *strnrepl(char *s, int32 size, const char *old, const char *newstr) { char *ptr = s; int32 left = strlen(s); int32 avail = size - (left + 1); int32 oldlen = strlen(old); - int32 newlen = strlen(new); + int32 newlen = strlen(newstr); int32 diff = newlen - oldlen; while (left >= oldlen) { @@ -161,7 +161,7 @@ char *strnrepl(char *s, int32 size, const char *old, const char *new) break; if (diff != 0) memmove(ptr + oldlen + diff, ptr + oldlen, left + 1 - oldlen); - strncpy(ptr, new, newlen); + strncpy(ptr, newstr, newlen); ptr += newlen; left -= oldlen; }