git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rewrite the device subsystem interfaces (#48)
[lunaix-os.git]
/
lunaix-os
/
libs
/
klibc
/
string
/
trim.c
diff --git
a/lunaix-os/libs/klibc/string/trim.c
b/lunaix-os/libs/klibc/string/trim.c
index c15e159a94b9c6809c4d58926f990a03417a02d6..82fbacc8622b85b642fe414874af3738d82a3a29 100644
(file)
--- a/
lunaix-os/libs/klibc/string/trim.c
+++ b/
lunaix-os/libs/klibc/string/trim.c
@@
-1,9
+1,10
@@
#include <klibc/string.h>
#include <klibc/string.h>
+#include <lunaix/compiler.h>
#define WS_CHAR(c) \
(c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\v' || c == '\r')
#define WS_CHAR(c) \
(c == ' ' || c == '\t' || c == '\n' || c == '\f' || c == '\v' || c == '\r')
-void
+void
_weak
strrtrim(char* str)
{
unsigned long l = strlen(str);
strrtrim(char* str)
{
unsigned long l = strlen(str);
@@
-18,7
+19,7
@@
strrtrim(char* str)
str[l + 1] = '\0';
}
str[l + 1] = '\0';
}
-char*
+char*
_weak
strltrim_safe(char* str)
{
unsigned long l = 0;
strltrim_safe(char* str)
{
unsigned long l = 0;
@@
-27,7
+28,7
@@
strltrim_safe(char* str)
l++;
}
l++;
}
- if (
!
l)
-
return str
;
- return str
cpy(str, str + l)
;
+ if (l)
+
strcpy(str, str + l)
;
+ return str;
}
\ No newline at end of file
}
\ No newline at end of file