Changeset 777 for soft/giet_vm/giet_libs/stdlib.c
- Timestamp:
- Feb 4, 2016, 6:25:22 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/giet_libs/stdlib.c
r772 r777 110 110 } 111 111 return dst; 112 }113 114 ///////////////////////////////////115 int strlen( const char* string )116 {117 unsigned int i = 0;118 while ( string[i] != 0 ) i++;119 return i;120 }121 122 ///////////////////////////////123 int strcmp( const char * s1,124 const char * s2 )125 {126 while (1)127 {128 if (*s1 != *s2) return 1;129 if (*s1 == 0) break;130 s1++, s2++;131 }132 return 0;133 }134 135 /////////////////////////136 char* strcpy( char* dest,137 const char* source )138 {139 if (!dest || !source) return dest;140 141 while (*source)142 {143 *(dest) = *(source);144 dest++;145 source++;146 }147 *dest = 0;148 return dest;149 112 } 150 113
Note: See TracChangeset
for help on using the changeset viewer.