summaryrefslogtreecommitdiff
blob: f6ed524e9b988cbee5e86566d15505dda5f7f0e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- libpng-1.2.5/pngerror.c.orig	Sun Jul 11 05:43:34 2004
+++ libpng-1.2.5/pngerror.c	Sun Jul 11 05:43:45 2004
@@ -23,6 +23,14 @@
 png_default_warning PNGARG((png_structp png_ptr,
   png_const_charp warning_message));
 
+size_t strnlen(const char *s, size_t limit)
+{
+   size_t len = 0;
+   while ((len < limit) && (*s++))
+     len++;
+   return len;
+}
+
 /* This function is called whenever there is a fatal error.  This function
  * should not be changed.  If there is a need to handle errors differently,
  * you should supply a replacement error function and use png_set_error_fn()