summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-11-03 19:11:36 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2020-11-03 19:11:36 +0200
commitc498250888ec126fddda2867d1239b2a7734482f (patch)
treee308174c977c0981d8e36f6f9b791b1b266d0cb0 /include
parent09a1f0075a8d5752dd7b2940a20d86a040af1741 (diff)
parent1418439d3823fe059b41092af72ab32d5e7cd7ab (diff)
downloadmariadb-git-c498250888ec126fddda2867d1239b2a7734482f.tar.gz
Diffstat (limited to 'include')
-rw-r--r--include/my_sys.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/my_sys.h b/include/my_sys.h
index 2ad4e131b3f..8507ec7a1eb 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -515,8 +515,11 @@ static inline int my_b_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
MEM_CHECK_DEFINED(Buffer, Count);
if (info->write_pos + Count <= info->write_end)
{
- memcpy(info->write_pos, Buffer, Count);
- info->write_pos+= Count;
+ if (Count)
+ {
+ memcpy(info->write_pos, Buffer, Count);
+ info->write_pos+= Count;
+ }
return 0;
}
return _my_b_write(info, Buffer, Count);