am bfde0b6f: Merge "glibc 2.15 treats errno as signed in strerror(3)."
* commit 'bfde0b6fd9e5de545746ab963d3a05ed2a8014f6':
glibc 2.15 treats errno as signed in strerror(3).
diff --git a/libc/bionic/strerror_r.cpp b/libc/bionic/strerror_r.cpp
index e6a3975..646cc52 100644
--- a/libc/bionic/strerror_r.cpp
+++ b/libc/bionic/strerror_r.cpp
@@ -49,7 +49,7 @@
if (error_name != NULL) {
length = snprintf(buf, buf_len, "%s", error_name);
} else {
- length = snprintf(buf, buf_len, "Unknown error %u", error_number);
+ length = snprintf(buf, buf_len, "Unknown error %d", error_number);
}
if (length >= buf_len) {
errno = ERANGE;
diff --git a/tests/string_test.cpp b/tests/string_test.cpp
index 71998d8..d55771c 100644
--- a/tests/string_test.cpp
+++ b/tests/string_test.cpp
@@ -39,7 +39,7 @@
ASSERT_STREQ("Operation not permitted", strerror(1));
// Invalid.
- ASSERT_STREQ("Unknown error 4294967295", strerror(-1));
+ ASSERT_STREQ("Unknown error -1", strerror(-1));
ASSERT_STREQ("Unknown error 1234", strerror(1234));
}