public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common/filter: prepend 0 to treat offset as octal
@ 2019-12-12  3:11 Naohiro Aota
  2019-12-12  6:04 ` Darrick J. Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Naohiro Aota @ 2019-12-12  3:11 UTC (permalink / raw)
  To: fstests; +Cc: Naohiro Aota

The offsets printed by "od" are octal numbers. So, we need to add "0" at
the head of the $offset to parse it as an octal number.

Fixes: 37520a314bd4 ("fstests: Don't use gawk's strtonum")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 common/filter | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/filter b/common/filter
index 6140e58368d7..88fcb6ef68ee 100644
--- a/common/filter
+++ b/common/filter
@@ -495,7 +495,7 @@ _filter_od()
 		fi
 
 		offset="${line%% *}"
-		printf '%o%s\n' $((offset / BLOCK_SIZE)) "${line#$offset}"
+		printf '%o%s\n' $(("0$offset" / BLOCK_SIZE)) "${line#$offset}"
 	done
 }
 
-- 
2.24.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-15 16:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-12  3:11 [PATCH] common/filter: prepend 0 to treat offset as octal Naohiro Aota
2019-12-12  6:04 ` Darrick J. Wong
2019-12-12  6:10   ` Darrick J. Wong
2019-12-12 10:00   ` Kusanagi Kouichi
2019-12-15 16:08     ` Eryu Guan
2019-12-15 16:07   ` Eryu Guan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox