Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/9979 )

Change subject: nat: ctrl: use strtol instead of atoi as it has explicit error 
documentation
......................................................................


Patch Set 2: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/9979/2/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c
File openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c:

https://gerrit.osmocom.org/#/c/9979/2/openbsc/src/osmo-bsc_nat/bsc_nat_ctrl.c@90
PS2, Line 90:   if (id_str[0] == '\0' || endptr[0] != '\0')
> No need to check it for our purposes here as far as I understand.
EINVAL (not in C99) The given base contains an unsupported value.

       ERANGE The resulting value was out of range.

rather check those, right?
we might also want to check that the returned long int is <= INT_MAX.



--
To view, visit https://gerrit.osmocom.org/9979
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ief0b203efbcf2be04253b5056840be94d58a9994
Gerrit-Change-Number: 9979
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-Reviewer: Pau Espin Pedrol <pes...@sysmocom.de>
Gerrit-Comment-Date: Thu, 12 Jul 2018 18:31:53 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes

Reply via email to