am 0f9be1ea: am bfde0b6f: Merge "glibc 2.15 treats errno as signed in strerror(3)."

* commit '0f9be1eaee5a9367fb2f8c6ed86ed2fc1faa70b9':
  glibc 2.15 treats errno as signed in strerror(3).
This commit is contained in:
Elliott Hughes 2013-01-11 10:54:43 -08:00 committed by Android Git Automerger
commit 376889ad71
2 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ int strerror_r(int error_number, char* buf, size_t buf_len) {
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;

View File

@ -39,7 +39,7 @@ TEST(string, strerror) {
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));
}