]> pd.if.org Git - pdclib.old/blobdiff - functions/string/strerror.c
PDCLIB-1 PDCLIB-2 PDCLIB-9 PDCLIB-12: Add thread specific locale support; migrate...
[pdclib.old] / functions / string / strerror.c
index 89ebed03581a0c533f398ce339172e530b0cf1d8..e050394b21778dcb12d7c221dc6b8e2383d0943c 100644 (file)
 
 #ifndef REGTEST
 
+#include <_PDCLIB_locale.h>
+
 /* TODO: Doing this via a static array is not the way to do it. */
 char * strerror( int errnum )
 {
-    return (char *)_PDCLIB_errno_texts[ errnum ];
+    if ( errnum == 0 || errnum >= _PDCLIB_ERRNO_MAX )
+    {
+        return (char *)"Unknown error";
+    }
+    else
+    {
+        return _PDCLIB_threadlocale()->_ErrnoStr[errnum];
+    }
 }
 
 #endif