replaces strlen function in puts in case not libc is used
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user