fileops: fix invalid read
diff: fix warning