summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-12-10 18:56:35 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2020-12-10 18:56:47 +0000
commita4d713d5ed71a80a020a14c1bb6cd04ab9fd4225 (patch)
treead4f0409dbbb86b4e6bf828d72bc3f2809501102
parentAdd override/explicit tags (diff)
downloadlibdbpp-mysql-a4d713d5ed71a80a020a14c1bb6cd04ab9fd4225.tar.bz2
libdbpp-mysql-a4d713d5ed71a80a020a14c1bb6cd04ab9fd4225.tar.xz
libdbpp-mysql-a4d713d5ed71a80a020a14c1bb6cd04ab9fd4225.zip
Fix/simply context buffer offset check
-rw-r--r--libmysqlpp/my-connection.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmysqlpp/my-connection.cpp b/libmysqlpp/my-connection.cpp
index 30cef18..5828986 100644
--- a/libmysqlpp/my-connection.cpp
+++ b/libmysqlpp/my-connection.cpp
@@ -154,9 +154,9 @@ namespace MySQL {
local_infile_read(void * obj, char * buf, unsigned int bufSize)
{
auto ctx = static_cast<LoadContext *>(obj);
- if (ctx->loadBufLen - ctx->bufOff == 0) {
+ if (ctx->loadBufLen == ctx->bufOff) {
ctx->swapContext();
- if (ctx->loadBufLen - ctx->bufOff <= 0) {
+ if (ctx->loadBufLen == ctx->bufOff) {
// Nothing to do or error
return ctx->bufOff;
}