fix(settings): change 2^16 to 65535

This commit is contained in:
Quentin McGaw
2022-01-06 17:42:10 +00:00
parent ab39edc692
commit 4c7a09c228
2 changed files with 3 additions and 3 deletions

View File

@@ -65,7 +65,7 @@ func stringsToPorts(ss []string) (ports []uint16, err error) {
if err != nil {
return nil, fmt.Errorf("%w: %s: %s",
ErrPortParsing, s, err)
} else if port < 1 || port > 2^16 {
} else if port < 1 || port > 65535 {
return nil, fmt.Errorf("%w: must be between 1 and 65535: %d",
ErrPortValue, port)
}

View File

@@ -49,8 +49,8 @@ func (r *Reader) readServerSelection(vpnProvider, vpnType string) (
if err != nil {
return ss, fmt.Errorf("%w: %s",
ErrServerNumberNotValid, numberString)
} else if number < 0 || number > 2^16 {
return ss, fmt.Errorf("%w: %d must be between 0 and 2^16",
} else if number < 0 || number > 65535 {
return ss, fmt.Errorf("%w: %d must be between 0 and 65535",
ErrServerNumberNotValid, number)
}
numbers[i] = uint16(number)