From 61db29ae5132161853151d412edc22e0ee07815f Mon Sep 17 00:00:00 2001 From: Antony Chazapis Date: Wed, 20 Sep 2023 14:46:09 +0300 Subject: [PATCH] Fix alignment check when there is no alignment --- direct_io.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/direct_io.go b/direct_io.go index 42ad06c..cc0464c 100644 --- a/direct_io.go +++ b/direct_io.go @@ -31,6 +31,9 @@ func alignment(block []byte, AlignSize int) int { // IsAligned checks wether passed byte slice is aligned func IsAligned(block []byte) bool { + if AlignSize == 0 { + return true + } return alignment(block, AlignSize) == 0 }