From 04a922fe1a3e6f510279c8656556ef448ab54e76 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 3 Apr 2015 13:14:59 +0100 Subject: [PATCH] Avoid zstr in write_debug when no *debug* buffer can be created --- src/debug.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/debug.cc b/src/debug.cc index 713124ee..799bffb8 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -13,7 +13,8 @@ void write_debug(StringView str) { if (not BufferManager::has_instance()) { - fprintf(stderr, "%s\n", (const char*)str.zstr()); + write(2, str.data(), (int)str.length()); + write(2, "\n", 1); return; }