changeset 9410:0791f3482d09

Change strerror so that it never returns an empty string.
author Bruno Haible <bruno@clisp.org>
date Sat, 27 Oct 2007 00:41:22 +0200
parents e5ff9d635a6f
children 5ea76912f0b5
files ChangeLog lib/strerror.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-10-26  Bruno Haible  <bruno@clisp.org>
+
+	* lib/strerror.c (rpl_strerror): Return "Unknown error ..." also if
+	strerror returned the empty string. Needed on HP-UX 11.00.
+
 2007-10-24  Micah Cowan  <micah@cowan.name>
 
 	Remove vestiges of cvs-gnulib-checkout process.  Now we use git.
--- a/lib/strerror.c
+++ b/lib/strerror.c
@@ -35,7 +35,7 @@
 {
   char *result = strerror (n);
 
-  if (! result)
+  if (result == NULL || result[0] == '\0')
     {
       static char const fmt[] = "Unknown error (%d)";
       static char mesg[sizeof fmt + INT_STRLEN_BOUND (n)];