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);
|
extern ssize_t _bsp_write(int, const void*, size_t);
|
||||||
|
|
||||||
int __wrap_puts(const char* s) {
|
int __wrap_puts(const char* s) {
|
||||||
int len = strlen(s);
|
const char* str = s;
|
||||||
return _bsp_write(STDOUT_FILENO, s, len);
|
while(*str)
|
||||||
|
str++;
|
||||||
|
return _bsp_write(STDOUT_FILENO, s, str - s);
|
||||||
}
|
}
|
||||||
weak_under_alias(puts);
|
weak_under_alias(puts);
|
||||||
|
Reference in New Issue
Block a user