Changeset 323 for trunk/kernel
- Timestamp:
- Aug 6, 2017, 8:33:00 AM (7 years ago)
- Location:
- trunk/kernel/libk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/libk/string.c
r288 r323 125 125 } 126 126 127 //////////////////////////////// 128 char * strstr( char * s, 129 const char * find) 130 { 131 char c, sc; 132 size_t len; 133 134 if ((c = *find++) != 0) { 135 len = strlen(find); 136 do { 137 do { 138 if ((sc = *s++) == 0) 139 return NULL; 140 } while (sc != c); 141 } while (strncmp(s, find, len) != 0); 142 s--; 143 } 144 return s; 145 } 146 127 147 ////////////////////////////// 128 148 char * strchr( const char * s, -
trunk/kernel/libk/string.h
r238 r323 103 103 104 104 /******************************************************************************************** 105 * This function locates the first occurence of the <find> string in the <s> string. 106 ******************************************************************************************** 107 * @ s : string to be analysed. 108 * @ find : searched string 109 * @ return pointer on the found string / return NULL if not found. 110 *******************************************************************************************/ 111 char * strstr( char * s, 112 const char * find); 113 114 /******************************************************************************************** 105 115 * This function locates the first occurence of the <c> character in the <s> string. 106 116 ********************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.