diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:08 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:08 +0000 |
commit | 407a45a3b73a6c776dc47ce69cea5f1611a0f3eb (patch) | |
tree | d680ff64ce281f8de8c09ff6c9004a9e25db3797 /src | |
parent | d73f104182c4964409f98f176a66d6a73ea2b7e1 (diff) |
Merge (with small conflict) from upstream.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1177 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src')
-rw-r--r-- | src/misc.c | 8 |
1 files 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; } |