From a4d713d5ed71a80a020a14c1bb6cd04ab9fd4225 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 10 Dec 2020 18:56:35 +0000 Subject: Fix/simply context buffer offset check --- libmysqlpp/my-connection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmysqlpp') 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(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; } -- cgit v1.2.3