Correct wrong string method calls (#69)
authorChristian Ullrich <chris@chrullrich.net>
Mon, 28 Oct 2024 09:49:59 +0000 (10:49 +0100)
committerGitHub <noreply@github.com>
Mon, 28 Oct 2024 09:49:59 +0000 (05:49 -0400)
These two calls have no effect because `std::string::empty()` only tests
for emptiness, but does not cause it as apparently intended.

pgxalib.cpp

index b476de847a59b8e8ec6a579e765f97f7f2ba5460..da07e7c96ca45918fb312a9f61e0e3c6682012ae 100755 (executable)
@@ -170,8 +170,8 @@ HDBC    XAConnection::ActivateConnection(void)
        SQLFreeHandle(SQL_HANDLE_DBC, xaconn);
        return NULL;
    }
-   sqlState.empty();
-   errMsg.empty();
+   sqlState.clear();
+   errMsg.clear();
    ret = SQLDriverConnect(xaconn, NULL,
         (SQLCHAR *) (dsnstr + ";Username=postgres;Password=postgres;sslmode=allow").c_str(), SQL_NTS, NULL, SQL_NULL_DATA, NULL, SQL_DRIVER_COMPLETE);
    if (SQL_SUCCEEDED(ret))