michaeldickens / Typing

https://github.com/michaeldickens/Typing
69 stars 18 forks source link

Potentially questionable value for numStart? #9

Open FrankDMartinez opened 12 years ago

FrankDMartinez commented 12 years ago

Hi, Presuming keysToInclude does not contain '1', the call to strchr() in initKeyboardData() will be NULL. Subtracting from this result can result in undefined/unspecified behavior, according to the ISO C standard. In the event this occurs, what would You suggest is a suitable default value for numStart? 0, perhaps?

michaeldickens commented 12 years ago

The default value for numStart should be -1, to indicate that '1' was not found.

On 7/30/12 12:31 PM, FrankDMartinez wrote:

Hi, Presuming keysToInclude does not contain '1', the call to strchr() in initKeyboardData() will be NULL. Subtracting from this result can result in undefined/unspecified behavior, according to the ISO C standard. In the event this occurs, what would You suggest is a suitable default value for numStart? 0, perhaps?


Reply to this email directly or view it on GitHub: https://github.com/MTGandP/Typing/issues/9