summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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';