| Revision: | 3.1 |
| Committed: | Sat Mar 1 00:51:26 2025 UTC (8 months ago) by greg |
| Content type: | text/plain |
| Branch: | MAIN |
| CVS Tags: | rad6R0, HEAD |
| Log Message: | chore: Added missing strncasecmp() library call for Windows |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | greg | 3.1 | #ifndef lint |
| 2 | static const char RCSid[] = "$Id$"; | ||
| 3 | #endif | ||
| 4 | /* | ||
| 5 | * Replacement for strncasecmp() library call | ||
| 6 | */ | ||
| 7 | |||
| 8 | #include "rtio.h" | ||
| 9 | #include <ctype.h> | ||
| 10 | |||
| 11 | int | ||
| 12 | strncasecmp(const char *s1, const char *s2, size_t n) | ||
| 13 | { | ||
| 14 | while (n-- > 0) { | ||
| 15 | int d = tolower(*s1++) - tolower(*s2); | ||
| 16 | |||
| 17 | if (d | !*s2++) return(d); | ||
| 18 | } | ||
| 19 | return(0); | ||
| 20 | } |