|
From: Ludovic R. <lud...@gm...> - 2013-08-02 08:44:56
|
2013/8/1 Sean McBride <se...@ro...>: > On Thu, 1 Aug 2013 06:28:27 +0200, Ludovic Rousseau said: > >>I still have 2 commits from Sean in my Xcode branch: >> >>- Core: defensive programming >>https://github.com/LudovicRousseau/libusbx/commit/ >>5da4949cffacf1a19aeaf62ce796019daa50c49d >>Not Xcode related. Maybe we can drop it. > > Why drop it? 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. I regenerated the commit message including your description above. https://github.com/LudovicRousseau/libusbx/commit/d29dfca8446cce264d8edf8a77aa8a789c0050d7 The commit message should include _why_ the commit is needed, more than _what_ it does. I now see why the commit is important. If no one objects I will push the change tomorrow. Bye -- Dr. Ludovic Rousseau |