From aca49379a5157d9274558ac40becec40f1a352e3 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 24 Nov 2014 07:38:26 -0800 Subject: [PATCH] Fix a few minor issues detected by CppCheck Thanks to Dmitry Andriyankov for reporting. --- format.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/format.cc b/format.cc index 82019f89..76988b49 100644 --- a/format.cc +++ b/format.cc @@ -474,9 +474,8 @@ void fmt::internal::format_system_error( FMT_TRY { MemoryBuffer buffer; buffer.resize(INLINE_BUFFER_SIZE); - char *system_message = 0; for (;;) { - system_message = &buffer[0]; + char *system_message = &buffer[0]; int result = safe_strerror(error_code, system_message, buffer.size()); if (result == 0) { out << message << ": " << system_message; @@ -888,7 +887,6 @@ template const Char *fmt::BasicFormatter::format( const Char *&format_str, const Arg &arg) { const Char *s = format_str; - const char *error = 0; FormatSpec spec; if (*s == ':') { if (arg.type == Arg::CUSTOM) { @@ -962,8 +960,6 @@ const Char *fmt::BasicFormatter::format( // Zero may be parsed again as a part of the width, but it is simpler // and more efficient than checking if the next char is a digit. spec.width_ = parse_nonnegative_int(s); - if (error) - FMT_THROW(FormatError(error)); } // Parse precision. @@ -972,8 +968,6 @@ const Char *fmt::BasicFormatter::format( spec.precision_ = 0; if ('0' <= *s && *s <= '9') { spec.precision_ = parse_nonnegative_int(s); - if (error) - FMT_THROW(FormatError(error)); } else if (*s == '{') { ++s; const Arg &precision_arg = parse_arg_index(s);