Skip to content

Commit

Permalink
Merge pull request #3 from arkbriar/fix-remove-null
Browse files Browse the repository at this point in the history
  • Loading branch information
xin053 authored Jan 25, 2022
2 parents c41f630 + 475dda3 commit f196c6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hsperfdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func DataPathsByProcessName(processName string) (map[string]string, error) {

// removeNull remove trailing '\x00' byte of s
func removeNull(s []byte) []byte {
if i := bytes.IndexByte(s, '\x00'); i > 0 {
if i := bytes.IndexByte(s, '\x00'); i >= 0 {
return s[:i]
}
return s
Expand Down

0 comments on commit f196c6c

Please sign in to comment.