mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-29 00:32:29 +00:00
Fix vfprintf and derived functions badly handling +/` flag conflict (#1269)
This commit is contained in:
parent
06a1193b4d
commit
6baf6cdb10
2 changed files with 9 additions and 1 deletions
|
@ -27,3 +27,11 @@ TEST(snprintf, testVeryLargePrecision) {
|
|||
ASSERT_EQ(i, 9999);
|
||||
ASSERT_EQ(strlen(buf), 511);
|
||||
}
|
||||
|
||||
TEST(snprintf, testPlusFlagOnChar) {
|
||||
char buf[10] = {};
|
||||
int i = snprintf(buf, sizeof(buf), "%+c", '=');
|
||||
|
||||
ASSERT_EQ(i, 1);
|
||||
ASSERT_STREQ(buf, "=");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue