about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2018-01-20 03:35:31 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2018-01-20 03:35:31 +0000
commit2c8fdc6afca5f3b43f6f6b650832d53db09dc9bf (patch)
tree32769b772b9a7d6a552ae81fba4b98c42d9f79b0
parent4e026d12139bb3ea85a6c5c70c51f8dbebcfe524 (diff)
downloadnetpbm-mirror-2c8fdc6afca5f3b43f6f6b650832d53db09dc9bf.tar.gz
netpbm-mirror-2c8fdc6afca5f3b43f6f6b650832d53db09dc9bf.tar.xz
netpbm-mirror-2c8fdc6afca5f3b43f6f6b650832d53db09dc9bf.zip
Release 10.81.02
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@3128 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--converter/ppm/sldtoppm.c2
-rw-r--r--doc/HISTORY5
-rw-r--r--lib/util/nstring.c13
-rw-r--r--lib/util/nstring.h4
-rw-r--r--version.mk2
5 files changed, 24 insertions, 2 deletions
diff --git a/converter/ppm/sldtoppm.c b/converter/ppm/sldtoppm.c
index 5ce92c2b..2dc049f8 100644
--- a/converter/ppm/sldtoppm.c
+++ b/converter/ppm/sldtoppm.c
@@ -215,7 +215,7 @@ scanDirectory(FILE *       const slFileP,
                followed by 4 bytes of offset of the next directory entry.
             */
             const char * const slideName = (const char *)(&libent[0]);
-            if (strnlen(slideName, 32) == 32)
+            if (pm_strnlen(slideName, 32) == 32)
                 pm_error("Invalid input: slide name field is not "
                          "nul-terminated");
             else {
diff --git a/doc/HISTORY b/doc/HISTORY
index f8039c26..6f3702e4 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,6 +4,11 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
+18.01.20 BJH  Release 10.81.02
+
+              Build: fix compile failure on systems without strnlen (such
+              as MacOS X before 10.7).  Broken in 10.81.00 (December 2017).
+
 18.01.05 BJH  Release 10.81.01
 
               ppmpat: Fix bug - crash or junk output with -camo or -anticamo
diff --git a/lib/util/nstring.c b/lib/util/nstring.c
index f9c8943d..9b132ee2 100644
--- a/lib/util/nstring.c
+++ b/lib/util/nstring.c
@@ -195,6 +195,19 @@ static char credits[] = "\n\
 @(#)snprintf.c, v2.2: http://www.ijs.si/software/snprintf/\n";
 
 
+/* MacOS X before 10.7, for one, does not have strnlen */
+size_t
+pm_strnlen(const char * const s,
+           size_t       const maxlen) {
+
+    unsigned int i;
+
+    for (i = 0; i < maxlen && s[i]; ++i) {}
+
+    return i;
+}
+
+
 
 void
 pm_vsnprintf(char *       const str,
diff --git a/lib/util/nstring.h b/lib/util/nstring.h
index 257b04b0..bded8417 100644
--- a/lib/util/nstring.h
+++ b/lib/util/nstring.h
@@ -150,6 +150,10 @@ strncaseeq(const char * const comparand,
 
 extern const char * const pm_strsol;
 
+size_t
+pm_strnlen(const char * const s,
+           size_t       const maxlen);
+
 int
 pm_snprintf(char *       const dest,
             size_t       const str_m,
diff --git a/version.mk b/version.mk
index 17391d82..4b998640 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
 NETPBM_MINOR_RELEASE = 81
-NETPBM_POINT_RELEASE = 1
+NETPBM_POINT_RELEASE = 2