Commit 00794a93 authored by James Zern's avatar James Zern

tools/ fix file truncation

truncate() operates from the current file pointer position. On at least
Linux specifying 0 without resetting the pointer will pad the file with
zeros to the current offset.

Change-Id: Ide704a1097f46c0c530f27212bb12e923f93e2d6
parent 8b15cf69
...@@ -59,6 +59,7 @@ def main(fileobj): ...@@ -59,6 +59,7 @@ def main(fileobj):
if fileobj == sys.stdin: if fileobj == sys.stdin:
fileobj = sys.stdout fileobj = sys.stdout
else: else:
fileobj.truncate(0) fileobj.truncate(0)
fileobj.write(output) fileobj.write(output)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment