aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2010-12-05 15:20:03 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2010-12-05 15:20:03 -0500
commit2fb784d8ce44979afcb4c7a9b4cc7f17be1c3ba1 (patch)
tree0b233411ae3ce91c9c6ac80e4ec834323d3f2b7d /src
parentb3dd3b1544688ecd6b1e7f86a66b91386ab993ba (diff)
downloadNetNuke2-2fb784d8ce44979afcb4c7a9b4cc7f17be1c3ba1.tar.gz
Initial commit
Diffstat (limited to 'src')
-rw-r--r--src/misc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c
new file mode 100644
index 0000000..9a38e63
--- /dev/null
+++ b/src/misc.c
@@ -0,0 +1,15 @@
+#include <string.h>
+
+/* Returns the index of the first occurence of ch in str */
+int strind(const char* str, const char ch)
+{
+ int index = 0;
+ while(*str != 0 || str == NULL)
+ {
+ if(*str == ch)
+ break;
+ ++index;
+ ++str;
+ }
+ return index;
+}