Support to multi-threading and pthread interface (POSIX.1-2008) (#23)
[lunaix-os.git] / lunaix-os / libs / klibc / string / trim.c
index fb907fa5673585413ac99c421b971d336414e585..abd6508801907179c0f18eaaf7e4a8d6e5f73bcf 100644 (file)
@@ -6,8 +6,8 @@
 void
 strrtrim(char* str)
 {
-    size_t l = strlen(str);
-    while (l < (size_t)-1) {
+    unsigned long l = strlen(str);
+    while (l < (unsigned long)-1) {
         char c = str[l];
         if (!c || WS_CHAR(c)) {
             l--;
@@ -21,13 +21,13 @@ strrtrim(char* str)
 char*
 strltrim_safe(char* str)
 {
-    size_t l = 0;
+    unsigned long l = 0;
     char c = 0;
     while ((c = str[l]) && WS_CHAR(c)) {
         l++;
     }
 
-    if (!l)
-        return str;
-    return strcpy(str, str + l);
+    if (l)
+        strcpy(str, str + l);
+    return str;
 }
\ No newline at end of file