aboutsummaryrefslogtreecommitdiffstats
path: root/src/inspstring.cpp
diff options
context:
space:
mode:
authorGravatar brain2006-08-10 14:43:29 +0000
committerGravatar brain2006-08-10 14:43:29 +0000
commit396c9ef9f7a96934d3227bb7d1d091315e3d4fa8 (patch)
treeb775fca47b8536d7e3c5df17480dbf4cca9f6ded /src/inspstring.cpp
parentChange to use the core perl module Cwd rather than the pwd command. Should be... (diff)
downloadinspircd++-396c9ef9f7a96934d3227bb7d1d091315e3d4fa8.tar.gz
inspircd++-396c9ef9f7a96934d3227bb7d1d091315e3d4fa8.tar.bz2
inspircd++-396c9ef9f7a96934d3227bb7d1d091315e3d4fa8.zip
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
Diffstat (limited to 'src/inspstring.cpp')
-rw-r--r--src/inspstring.cpp39
1 files changed, 38 insertions, 1 deletions
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;
+}
+