summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-03-02 21:25:51 +0000
committerKarl Berry <karl@freefriends.org>2020-03-02 21:25:51 +0000
commit35f4a6396dbd7a9fa727e130f4ae0ba2fa20cbed (patch)
treefc9be4b69ac07d4a3d546f949b89dd8c393d9d9f /Build/source
parentc699c1a0b8242a5f86e0ab3f5e1fa5e7754dff33 (diff)
avoid strnlen
git-svn-id: svn://tug.org/texlive/trunk@54012 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/xdvik/ChangeLog6
-rw-r--r--Build/source/texk/xdvik/main.c5
2 files changed, 10 insertions, 1 deletions
diff --git a/Build/source/texk/xdvik/ChangeLog b/Build/source/texk/xdvik/ChangeLog
index 0b6898cccbd..bfb06942ce8 100644
--- a/Build/source/texk/xdvik/ChangeLog
+++ b/Build/source/texk/xdvik/ChangeLog
@@ -1,3 +1,9 @@
+2020-03-02 Karl Berry <karl@freefriends.org>
+
+ * main.c (is_good_dvi_file): avoid using strnlen, not present
+ on Solaris.
+ https://tug.org/pipermail/tlbuild/2020q1/004659.html
+
2020-03-01 Karl Berry <karl@freefriends.org>
* Import xdvi-22.87.04 from
diff --git a/Build/source/texk/xdvik/main.c b/Build/source/texk/xdvik/main.c
index 11814e7633a..407c2af4eeb 100644
--- a/Build/source/texk/xdvik/main.c
+++ b/Build/source/texk/xdvik/main.c
@@ -455,7 +455,10 @@ is_good_dvi_file(const char *filename, Boolean from_history)
if ((ret = REALPATH(real_filename, canonical_path)) == NULL) {
/* REALPATH failed, use real_filename */
- size_t n = strnlen(real_filename, MAXPATHLEN);
+ size_t n = strlen(real_filename);
+ if (n >= MAXPATHLEN) {
+ n = MAXPATHLEN;
+ }
memcpy(canonical_path, real_filename, n);
canonical_path[n] = '\0';