Skip to content

Commit

Permalink
Merge pull request #49 from DmytroLinkin/master
Browse files Browse the repository at this point in the history
Trim spaces when reading sfnum file in GetSfIndexByAuxDev()
  • Loading branch information
moshe010 authored Mar 27, 2022
2 parents bf007ca + 07a0080 commit e360783
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sriovnet_aux.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"fmt"
"path/filepath"
"strconv"
"strings"

utilfs "github.com/Mellanox/sriovnet/pkg/utils/filesystem"
)
Expand All @@ -47,7 +48,7 @@ func GetSfIndexByAuxDev(auxDev string) (int, error) {
return -1, fmt.Errorf("cannot read sfnum file for %s device: %v", auxDev, err)
}

sfnum, err := strconv.Atoi(string(sfNumStr))
sfnum, err := strconv.Atoi(strings.TrimSpace(string(sfNumStr)))
if err != nil {
return -1, err
}
Expand Down

0 comments on commit e360783

Please sign in to comment.