Skip to content

Commit

Permalink
Used parseUint instead ParseInt to increase the range (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
vthiruveedula authored Nov 3, 2022
1 parent 606c239 commit ce109ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nasConvert/SessionAMBR.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func ModelsToSessionAMBR(ambr *models.Ambr) (sessAmbr nasType.SessionAMBR) {
fmt.Println(ambr)

uplink := strings.Split(ambr.Uplink, " ")
if bitRate, err := strconv.ParseInt(uplink[0], 10, 16); err != nil {
if bitRate, err := strconv.ParseUint(uplink[0], 10, 16); err != nil {
logger.ConvertLog.Warnf("uplink AMBR parse failed: %+v", err)
} else {
var bitRateBytes [2]byte
Expand All @@ -32,7 +32,7 @@ func ModelsToSessionAMBR(ambr *models.Ambr) (sessAmbr nasType.SessionAMBR) {
sessAmbr.SetUnitForSessionAMBRForUplink(strToAMBRUnit(uplink[1]))

downlink := strings.Split(ambr.Downlink, " ")
if bitRate, err := strconv.ParseInt(downlink[0], 10, 16); err != nil {
if bitRate, err := strconv.ParseUint(downlink[0], 10, 16); err != nil {
logger.ConvertLog.Warnf("downlink AMBR parse failed: %+v", err)
} else {
var bitRateBytes [2]byte
Expand Down

0 comments on commit ce109ed

Please sign in to comment.