diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-08-10 19:03:46 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-08-10 19:03:46 +0200 |
| commit | 572caa74ed824fefa02eb81adc7639a783f243c7 (patch) | |
| tree | 9938efe957a708a3642c19a03fdacaaa2b0618d5 /src/strops.cpp | |
| parent | 3c83a2d06cf33429ca0e654a415fc95581df46e1 (diff) | |
working on invoice form
Diffstat (limited to 'src/strops.cpp')
| -rw-r--r-- | src/strops.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/strops.cpp b/src/strops.cpp index 42042cb..116eec4 100644 --- a/src/strops.cpp +++ b/src/strops.cpp @@ -1,4 +1,5 @@ #include <string.h> +#include <ctype.h> #include "strops.hpp" @@ -15,4 +16,20 @@ size_t strops_copy(char *dst, const char *src, size_t size) dst[srclen] = '\0'; return (srclen); +} + +char* strops_stristr(char* haystack, char* needle) +{ + do { + const char* h = haystack; + const char* n = needle; + while (tolower((unsigned char) *h) == tolower((unsigned char ) *n) && *n) { + h++; + n++; + } + if (*n == 0) { + return (char *) haystack; + } + } while (*haystack++); + return 0; }
\ No newline at end of file |
