aboutsummaryrefslogtreecommitdiffstats
path: root/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils.h b/utils.h
new file mode 100644
index 0000000..eaf4004
--- /dev/null
+++ b/utils.h
@@ -0,0 +1,8 @@
+#include <stddef.h>
+
+char *rstrchr(const char *s, char *start, char c) {
+ char *ret = start;
+ while ((ret > s) && (*ret != c)) ret--;
+ if ((s == ret) && (*s != c)) return NULL;
+ else return ret;
+}