From 1bbe71637e6b10aea3cb10db1fe3c7bb80f6382b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 25 Nov 2014 08:53:16 +0200 Subject: Get rid of trailing newlines in error messages --- odb/mssql/error.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/odb/mssql/error.cxx b/odb/mssql/error.cxx index 0c41d32..7ac3f88 100644 --- a/odb/mssql/error.cxx +++ b/odb/mssql/error.cxx @@ -3,6 +3,7 @@ // license : ODB NCUEL; see accompanying LICENSE file #include +#include // std::strlen #include #include @@ -222,6 +223,12 @@ namespace odb conn->mark_failed (); } + // Get rid of a trailing newline if there is one. + // + size_t n (strlen (msg)); + if (n != 0 && msg[n - 1] == '\n') + msg[n - 1] = '\0'; + e.append (native_code, sqlstate, msg); } else -- cgit v1.1