diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2010-12-05 15:20:03 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2010-12-05 15:20:03 -0500 |
commit | 2fb784d8ce44979afcb4c7a9b4cc7f17be1c3ba1 (patch) | |
tree | 0b233411ae3ce91c9c6ac80e4ec834323d3f2b7d /src | |
parent | b3dd3b1544688ecd6b1e7f86a66b91386ab993ba (diff) | |
download | NetNuke2-2fb784d8ce44979afcb4c7a9b4cc7f17be1c3ba1.tar.gz |
Initial commit
Diffstat (limited to 'src')
-rw-r--r-- | src/misc.c | 15 |
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; +} |