]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r299778:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 8 Jun 2016 17:32:41 +0000 (17:32 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 8 Jun 2016 17:32:41 +0000 (17:32 +0000)
commit1da48da8f1df462a534fc293bf95e9001cbe50b9
treeb1dd431b8ac75c99d0d5a4d36ce5d68a9c8672cf
parenteafe402257f5b4415ca51b1a3d4e429ebfdad04a
MFC r299778:

Use a consistent errno save/restore pattern before running strtoul

- Save errno
- Set errno to 0
- Call strtoul
- Test errno (optional, but many calls to strtoul did this afterwards)

Some of the code was setting errno = 0 after calling strtoul, not setting
errno = 0, or setting errno to saved_errno after the call, but before the
test. These all have unwanted behavioral side-effects, depending on the
initial value of errno and whether or not the input to strtoul was correct
or incorrect.

git-svn-id: svn://svn.freebsd.org/base/stable/10@301656 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c