From ed83058f4e8e36ad65fed090f4546fff5ee61c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Sat, 14 Mar 2020 23:48:17 +0100 Subject: [PATCH] epr config - int parse bug --- server/internal/types/config/webrtc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/internal/types/config/webrtc.go b/server/internal/types/config/webrtc.go index 3499c02..d779358 100644 --- a/server/internal/types/config/webrtc.go +++ b/server/internal/types/config/webrtc.go @@ -142,13 +142,13 @@ func (s *WebRTC) Set() { max := uint16(59100) epr := viper.GetString("epr") ports := strings.SplitN(epr, "-", -1) - if len(ports[0]) > 1 { - start, err := strconv.ParseUint(ports[0], 16, 16) + if len(ports) > 1 { + start, err := strconv.ParseUint(ports[0], 10, 16) if err == nil { min = uint16(start) } - end, err := strconv.ParseUint(ports[1], 16, 16) + end, err := strconv.ParseUint(ports[1], 10, 16) if err == nil { max = uint16(end) }