AcessNative - Added heap shim to libacess-native, disabled spawn
[tpg/acess2.git] / Usermode / Libraries / libc.so_src / string.c
index 3cadee9..3d30f1c 100644 (file)
@@ -100,6 +100,18 @@ EXPORT char *strcat(char *dst, const char *src)
        return dst;
 }
 
+EXPORT char *strncat(char *dst, const char *src, size_t n)
+{
+       char    *to = dst;
+       // Find the end
+       while(*to)      to++;
+       // Copy
+       while(*src && n--)      *to++ = *src++;
+       // End string
+       *to = '\0';
+       return dst;
+}
+
 /**
  * \brief Get the length of a string
  */
@@ -273,7 +285,7 @@ EXPORT void *memmove(void *dest, const void *src, size_t count)
        char *sp = (char *)src;
        char *dp = (char *)dest;
        // Check if the areas overlap
-       if( (intptr_t)src < (intptr_t)dest && (intptr_t)dest < (intptr_t)src+count )
+       if( (uintptr_t)src < (uintptr_t)dest && (uintptr_t)dest < (uintptr_t)src+count )
                for(;count--;)
                        dp[count] = sp[count];
        else

UCC git Repository :: git.ucc.asn.au