Skip to content

Commit 5814a54

Browse files
committed
Stripping null bytes
1 parent fab03ae commit 5814a54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/fs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ func getDiskStatsMap(diskStatsFile string) (map[string]DiskStats, error) {
469469
for {
470470
buf := make([]byte, bufSize)
471471
count, err := file.Read(buf)
472-
buf = append(leftover, buf...)
472+
buf = append(leftover, bytes.Trim(buf, "\x00")...)
473473
klog.V(10).Infof("read %d bytes in getDiskStatsMap()", count)
474474
if err == io.EOF {
475475
break

0 commit comments

Comments
 (0)