commit | fedc3631f88462d7dfa6af7fc1328b5675eea059 | [log] [tgz] |
---|---|---|
author | Sean McBride <sean@rogue-research.com> | Fri Oct 12 17:31:45 2012 -0400 |
committer | Ludovic Rousseau <ludovic.rousseau+github@gmail.com> | Fri Aug 02 11:30:16 2013 +0200 |
tree | c5cac2e76ea85fb298f198a1c557ccdeefaa0b13 | |
parent | b5acea3591ee713ec3392e8d3c8ba59e848d8641 [diff] |
Core: defensive programming Defensively set return-by-reference value to -1 in error condition NB: The comments do not match the implementation. Comments: "[return] the index of the configuration matching a specific bConfigurationValue in the idx output parameter, or -1 if the config was not found" There is a code path where idx is never touched. Perhaps clients of the function are careful to only read idx if the return value is success, but also setting idx to -1 is much safer.