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

@ -2,10 +2,12 @@
#include <string.h>
#include <unistd.h>
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 len = strlen(s);
return _bsp_write(STDOUT_FILENO, s, len);
int __wrap_puts(const char* s) {
const char* str = s;
while(*str)
str++;
return _bsp_write(STDOUT_FILENO, s, str - s);
}
weak_under_alias(puts);