summaryrefslogtreecommitdiff
path: root/tests/stdio_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdio_test.cpp')
-rw-r--r--tests/stdio_test.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index 2cd0df25a..c01ab683c 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -428,7 +428,7 @@ TEST(stdio, snprintf_negative_zero_5084292) {
TEST(stdio, snprintf_utf8_15439554) {
locale_t cloc = newlocale(LC_ALL, "C.UTF-8", 0);
- uselocale(cloc);
+ locale_t old_locale = uselocale(cloc);
// http://b/15439554
char buf[BUFSIZ];
@@ -446,6 +446,7 @@ TEST(stdio, snprintf_utf8_15439554) {
snprintf(buf, sizeof(buf), "%d\xf0\xa4\xad\xa2%d", 1, 2);
EXPECT_STREQ("1𤭢2", buf);
+ uselocale(old_locale);
freelocale(cloc);
}