Typing icon indicating copy to clipboard operation
Typing copied to clipboard

Potentially questionable value for numStart?

Open FrankDMartinez opened this issue 12 years ago • 1 comments

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?

FrankDMartinez avatar Jul 30 '12 17:07 FrankDMartinez

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

michaeldickens avatar Jul 30 '12 18:07 michaeldickens