summaryrefslogtreecommitdiffstats
path: root/src/H5FDdirect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FDdirect.c')
-rw-r--r--src/H5FDdirect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c
index 23ff0fe..b078511 100644
--- a/src/H5FDdirect.c
+++ b/src/H5FDdirect.c
@@ -976,7 +976,7 @@ H5FD_direct_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, ha
* copy buffer size. Make a bigger buffer for aligned I/O if size is
* smaller than maximal copy buffer. */
if(size < _cbsize)
- alloc_size = (size / _fbsize + 1) * _fbsize + _fbsize;
+ alloc_size = ((size / _fbsize) * _fbsize) + _fbsize;
else
alloc_size = _cbsize;
if (HDposix_memalign(&copy_buf, _boundary, alloc_size) != 0)
@@ -1141,7 +1141,7 @@ H5FD_direct_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, h
* smaller than maximal copy buffer.
*/
if(size < _cbsize)
- alloc_size = (size / _fbsize + 1) * _fbsize + _fbsize;
+ alloc_size = ((size / _fbsize) * _fbsize) + _fbsize;
else
alloc_size = _cbsize;