|
|
@ -5,7 +5,6 @@ unsigned int strlen(char* str) { |
|
|
|
for( c = str; *c != '\0'; c++ ) // search for end-of-string
|
|
|
|
for( c = str; *c != '\0'; c++ ) // search for end-of-string
|
|
|
|
|
|
|
|
|
|
|
|
return (unsigned int)(c - str); // get size by delta-address
|
|
|
|
return (unsigned int)(c - str); // get size by delta-address
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
char* strcat(char* buf, char* str) { |
|
|
|
char* strcat(char* buf, char* str) { |
|
|
@ -15,7 +14,11 @@ char* strcat(char* buf, char* str) { |
|
|
|
*(buf + bufferlen) = 0x3f; // placeholder
|
|
|
|
*(buf + bufferlen) = 0x3f; // placeholder
|
|
|
|
|
|
|
|
|
|
|
|
// concat the str to buf
|
|
|
|
// concat the str to buf
|
|
|
|
|
|
|
|
int cc = 0; |
|
|
|
for( char* c = str; *c != '\0'; c++ ) { |
|
|
|
for( char* c = str; *c != '\0'; c++ ) { |
|
|
|
|
|
|
|
*(buf + bufferlen + cc) = *c; |
|
|
|
|
|
|
|
cc++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return buf; |
|
|
|
} |
|
|
|
} |
|
|
|