fix(settings): change 2^16 to 65535
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user