Author: sebor
Date: Tue Nov 14 13:35:36 2006
New Revision: 474992

URL: http://svn.apache.org/viewvc?view=rev&rev=474992
Log:
2006-11-14  Martin Sebor  <[EMAIL PROTECTED]>

        * printf.cpp (test_errno): Removed assumption that strerror()
        never returns a null pointer (see STDCXX-305).

Modified:
    incubator/stdcxx/trunk/tests/self/0.printf.cpp

Modified: incubator/stdcxx/trunk/tests/self/0.printf.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/tests/self/0.printf.cpp?view=diff&rev=474992&r1=474991&r2=474992
==============================================================================
--- incubator/stdcxx/trunk/tests/self/0.printf.cpp (original)
+++ incubator/stdcxx/trunk/tests/self/0.printf.cpp Tue Nov 14 13:35:36 2006
@@ -2161,7 +2161,11 @@
     for (int i = 0; i != 256; ++i) {
 
         char expect [256];
-        strcpy (expect, strerror (i));
+
+        // be prepared to deal with non-conforming implementations
+        // of strerror() (such as IRIX) that return a null pointer
+        const char* const str = strerror (i);
+        strcpy (expect, str ? str : "(null)");
 
         errno = i;
 


Reply via email to