From 22d572d7a2c4249371c77e49e8333623d5ec0608 Mon Sep 17 00:00:00 2001 From: vitaut Date: Tue, 20 Oct 2015 06:23:16 -0700 Subject: [PATCH] Fix potential segfault when exceptions are disabled --- format.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format.cc b/format.cc index a9c978b9..84447d2f 100644 --- a/format.cc +++ b/format.cc @@ -782,7 +782,7 @@ void fmt::BasicWriter::write_str( if (str_size == 0) { if (!str_value) FMT_THROW(FormatError("string pointer is null")); - if (*str_value) + else if (*str_value) str_size = std::char_traits::length(str_value); } std::size_t precision = spec.precision_;