replaces strlen function in puts in case not libc is used
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
extern ssize_t _bsp_write(int, const void*, size_t);
|
||||
|
||||
int __wrap_puts(const char* s) {
|
||||
int len = strlen(s);
|
||||
return _bsp_write(STDOUT_FILENO, s, len);
|
||||
const char* str = s;
|
||||
while(*str)
|
||||
str++;
|
||||
return _bsp_write(STDOUT_FILENO, s, str - s);
|
||||
}
|
||||
weak_under_alias(puts);
|
||||
|
Reference in New Issue
Block a user