replaces strlen function in puts in case not libc is used

This commit is contained in:
2025-07-04 13:16:50 +02:00
parent a33b51a708
commit 74fd5b0a2b

View File

@@ -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);