Switch strncpy to truncate_cpy in a bunch of places.

This commit is contained in:
Henrik Rydgård committed 2017-05-26 19:04:08 +02:00
1 parent 083f7ff280
commit 21fe73c8e7
9 files changed
+22 -19

No files matched your search

+2 -1
View File
@@ -21,6 +21,7 @@
#include "MemoryUtil.h"
#include "MemArena.h"
#include "StringUtils.h"
#include <sys/stat.h>
#include <fcntl.h>
@@ -49,7 +50,7 @@ static int ashmem_create_region(const char *name, size_t size) {
int ret;
if (name) {
char buf[ASHMEM_NAME_LEN];
strncpy(buf, name, sizeof(buf));
truncate_cpy(buf, name);
ret = ioctl(fd, ASHMEM_SET_NAME, buf);
if (ret < 0)
goto error;