handle both positive and negative errno's
authorLennart Poettering <lennart@poettering.net>
Thu, 19 Feb 2009 02:56:31 +0000 (03:56 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 19 Feb 2009 02:56:31 +0000 (03:56 +0100)
src/pulsecore/core-error.c

index 3d6c2c3..d9caa94 100644 (file)
@@ -47,6 +47,9 @@ const char* pa_cstrerror(int errnum) {
     char *translated, *t;
     char errbuf[128];
 
+    if (errnum < 0)
+        errnum = -errnum;
+
     if ((t = PA_STATIC_TLS_GET(cstrerror)))
         pa_xfree(t);