Changeset 1067
- Timestamp:
- 10/03/08 12:25:32 (3 months ago)
- Files:
-
- 1 modified
-
Whitix/branches/keobject/lib/string.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/keobject/lib/string.c
r936 r1067 20 20 #include <string.h> 21 21 22 int strncpy(char* dest,char* src, int len)22 int strncpy(char* dest,char* src, int len) 23 23 { 24 24 while (*src != '\0' && len--) … … 76 76 77 77 SYMBOL_EXPORT(strnicmp); 78 79 int stricmp(const char* s1, const char* s2) 80 { 81 unsigned char res=0; 82 83 while (1) 84 { 85 char a = toupper(*s1), b = toupper(*s2); 86 if (( res = a - b )) 87 break; 88 89 s1++; s2++; 90 } 91 92 return res; 93 } 94 95 SYMBOL_EXPORT(stricmp); 78 96 79 97 int strlen(char* str) … … 174 192 175 193 SYMBOL_EXPORT(toupper); 194 195 char* strdup(char* name) 196 { 197 char* ret; 198 199 ret = MemAlloc(strlen(name) + 1); 200 strcpy(ret, name); 201 202 return ret; 203 } 204 205 SYMBOL_EXPORT(strdup);