summaryrefslogtreecommitdiff
path: root/programs
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2020-11-15 01:23:40 -0800
committerGitHub <noreply@github.com>2020-11-15 01:23:40 -0800
commit0bd7dafc93bae758e86260a63a3f1efb4eac1d82 (patch)
tree5558e50e59d0c201de6e12bc96ad51aa87c05aa3 /programs
parentc1c3d04f1c44ed3d3a37bf7e643e6d542f5311c3 (diff)
parentf61b034cd7cd16c288db999263a77ab8a0e05610 (diff)
downloadlz4-0bd7dafc93bae758e86260a63a3f1efb4eac1d82.tar.gz
lz4-0bd7dafc93bae758e86260a63a3f1efb4eac1d82.tar.bz2
lz4-0bd7dafc93bae758e86260a63a3f1efb4eac1d82.zip
Merge pull request #953 from lz4/vs2005
better MSVC conformance
Diffstat (limited to 'programs')
-rw-r--r--programs/util.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/programs/util.h b/programs/util.h
index 2f3d0a8..733c1ca 100644
--- a/programs/util.h
+++ b/programs/util.h
@@ -594,15 +594,15 @@ UTIL_createFileList(const char** inputNames, unsigned inputNamesNb,
for (i=0, pos=0, nbFiles=0; i<inputNamesNb; i++) {
if (!UTIL_isDirectory(inputNames[i])) {
- size_t const len = strlen(inputNames[i]);
+ size_t const len = strlen(inputNames[i]) + 1; /* include nul char */
if (pos + len >= bufSize) {
while (pos + len >= bufSize) bufSize += LIST_SIZE_INCREASE;
buf = (char*)UTIL_realloc(buf, bufSize);
if (!buf) return NULL;
}
assert(pos + len < bufSize);
- strncpy(buf + pos, inputNames[i], bufSize - pos);
- pos += len + 1;
+ memcpy(buf + pos, inputNames[i], len);
+ pos += len;
nbFiles++;
} else {
char* bufend = buf + bufSize;