Skip to content

Commit

Permalink
Changed port to be parsed as uint instead of int
Browse files Browse the repository at this point in the history
  • Loading branch information
camgraff committed Aug 29, 2020
1 parent c6b4c74 commit f376254
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func Wizard(path string, listAllInterfaces bool) error {
}
// Ask for port
validatePort := func(input string) error {
_, err := strconv.ParseInt(input, 10, 16)
_, err := strconv.ParseUint(input, 10, 16)
if err != nil {
return errors.New("Invalid number")
}
Expand All @@ -154,7 +154,7 @@ func Wizard(path string, listAllInterfaces bool) error {
Default: fmt.Sprintf("%d", cfg.Port),
}
if promptPortResultString, err := promptPort.Run(); err == nil {
if port, err := strconv.ParseInt(promptPortResultString, 10, 16); err == nil {
if port, err := strconv.ParseUint(promptPortResultString, 10, 16); err == nil {
cfg.Port = int(port)
}
}
Expand Down

0 comments on commit f376254

Please sign in to comment.