summaryrefslogtreecommitdiff
path: root/include/my_sys.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_sys.h')
-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 505f3a056a5..d8101057f7c 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -538,8 +538,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);