aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/mssql/error.cxx7
1 files changed, 7 insertions, 0 deletions
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 <string>
+#include <cstring> // std::strlen
#include <odb/mssql/mssql.hxx>
#include <odb/mssql/error.hxx>
@@ -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