summary refs log tree commit diff
path: root/malloc/obstack.c
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/obstack.c')
-rw-r--r--malloc/obstack.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/malloc/obstack.c b/malloc/obstack.c
index dcc5cce386..2e50397150 100644
--- a/malloc/obstack.c
+++ b/malloc/obstack.c
@@ -481,8 +481,15 @@ static void
 __attribute__ ((noreturn))
 print_and_abort ()
 {
-  fputs (_("memory exhausted"), stderr);
-  fputc ('\n', stderr);
+#if defined _LIBC && defined USE_IN_LIBIO
+  if (_IO_fwide (stderr, 0) > 0)
+    __fwprintf (stderr, L"%s\n", _("memory exhausted"));
+  else
+#endif
+    {
+      fputs (_("memory exhausted"), stderr);
+      fputc ('\n', stderr);
+    }
   exit (obstack_exit_failure);
 }