Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print warnings/errors when numerical parameters cannot be parsed
Using the atoi method is a best effort method that parses as much of the input string as possible as integer and ignores the rest or return 0 if the string cannot be parsed. This is lead to unexpected results. Change the behaviour by printing a warning in these cases instead. When parsing a configuration, these warnings will error out since the msglevel is M_USAGE in this case. Example: ./src/openvpn/openvpn --resolv-retry 198jj Options error: Cannot parse argument '198jj' as non-negative integer Reported-By: Anqi Chen <[email protected]> Reported-By: Cristina Nita-Rotaru <[email protected]> Change-Id: Ie1e2eb54d516b3ae87c5ca56fe8edd77ee2be4de Signed-off-by: Arne Schwabe <[email protected]> Acked-by: Gert Doering <[email protected]> Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg30627.html Signed-off-by: Gert Doering <[email protected]>
- Loading branch information