Skip to content

Commit

Permalink
Stripping NUL bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
iwankgb committed Jul 20, 2023
1 parent fab03ae commit e615b02
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ func getDiskStatsMap(diskStatsFile string) (map[string]DiskStats, error) {
buf := make([]byte, bufSize)
count, err := file.Read(buf)
buf = append(leftover, buf...)
buf, _ = bytes.CutSuffix(buf, []byte("\x00"))

Check failure on line 473 in fs/fs.go

View workflow job for this annotation

GitHub Actions / test (1.19, ubuntu-20.04, build/config/plain.sh)

undefined: bytes.CutSuffix) (typecheck)

Check failure on line 473 in fs/fs.go

View workflow job for this annotation

GitHub Actions / test (1.19, ubuntu-20.04, build/config/plain.sh)

undefined: bytes.CutSuffix) (typecheck)

Check failure on line 473 in fs/fs.go

View workflow job for this annotation

GitHub Actions / test (1.19, ubuntu-20.04, build/config/plain.sh)

undefined: bytes.CutSuffix) (typecheck)

Check failure on line 473 in fs/fs.go

View workflow job for this annotation

GitHub Actions / test (1.19, ubuntu-20.04, build/config/plain.sh)

undefined: bytes.CutSuffix) (typecheck)

Check failure on line 473 in fs/fs.go

View workflow job for this annotation

GitHub Actions / test (1.19, ubuntu-20.04, build/config/plain.sh)

undefined: bytes.CutSuffix) (typecheck)
klog.V(10).Infof("read %d bytes in getDiskStatsMap()", count)
if err == io.EOF {
break
Expand Down

0 comments on commit e615b02

Please sign in to comment.