[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] better implementation of stpcpy for pre-Android 21 NDK
commit 4913b0ca323c62fa623c3e4a070e658b46cf3cae
Author: Nathan Freitas <nathan@xxxxxxxxxxx>
Date: Mon Jan 25 11:57:16 2016 -0500
better implementation of stpcpy for pre-Android 21 NDK
---
jni/pdnsd/src/cache.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/jni/pdnsd/src/cache.c b/jni/pdnsd/src/cache.c
index 82d7088..32d28cc 100644
--- a/jni/pdnsd/src/cache.c
+++ b/jni/pdnsd/src/cache.c
@@ -2699,8 +2699,10 @@ int dump_cache(int fd, const unsigned char *name, int exact)
char *stpcpy(char *dest, char const *src)
{
- strcpy(dest, src);
- return dest + strlen(dest);
+ size_t src_len = strlen(src);
+ return memcpy(dest, src, src_len) + src_len;
+ // strcpy(dest, src);
+ // return dest + strlen(dest);
}
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits