Changeset 6128390 in mainline for uspace/lib/posix/strings.c
- Timestamp:
- 2011-06-18T23:00:14Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 63fc519
- Parents:
- 9b1503e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/strings.c
r9b1503e r6128390 39 39 #include "strings.h" 40 40 #include "string.h" 41 #include "ctype.h" 41 42 42 43 /** … … 59 60 int posix_strcasecmp(const char *s1, const char *s2) 60 61 { 61 // TODO 62 not_implemented(); 62 return posix_strncasecmp(s1, s2, STR_NO_LIMIT); 63 63 } 64 64 … … 72 72 int posix_strncasecmp(const char *s1, const char *s2, size_t n) 73 73 { 74 // TODO 75 not_implemented(); 74 for (size_t i = 0; i < n; ++i) { 75 int cmp = tolower(s1[i]) - tolower(s2[i]); 76 if (cmp != 0) { 77 return cmp; 78 } 79 80 if (s1[i] == 0) { 81 return 0; 82 } 83 } 84 85 return 0; 76 86 } 77 87
Note:
See TracChangeset
for help on using the changeset viewer.