From 396c9ef9f7a96934d3227bb7d1d091315e3d4fa8 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 10 Aug 2006 14:43:29 +0000 Subject: FindNick, FindChan, ChanModes, UserList, CountInvisible, PurgeEmptyChannels, GetClass, WriteOpers, GetServerDescription -> into classes ServerConfig takes InspIRCd pointer in its constructor git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4832 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspstring.cpp | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'src/inspstring.cpp') diff --git a/src/inspstring.cpp b/src/inspstring.cpp index 4f1875b8c..71aed43ba 100644 --- a/src/inspstring.cpp +++ b/src/inspstring.cpp @@ -74,7 +74,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz) do { if ((*d++ = *s++) == 0) - break; + break; } while (--n != 0); } @@ -90,3 +90,40 @@ size_t strlcpy(char *dst, const char *src, size_t siz) return(s - src - 1); /* count does not include NUL */ } #endif + +int charlcat(char* x,char y,int z) +{ + char* x__n = x; + int v = 0; + + while(*x__n++) + v++; + + if (v < z - 1) + { + *--x__n = y; + *++x__n = 0; + } + + return v; +} + +bool charremove(char* mp, char remove) +{ + char* mptr = mp; + bool shift_down = false; + + while (*mptr) + { + if (*mptr == remove) + shift_down = true; + + if (shift_down) + *mptr = *(mptr+1); + + mptr++; + } + + return shift_down; +} + -- cgit v1.3.1-10-gc9f91