Description
The num parameter for measureTextWidth is labelled as "max" characters when in actual fact it is used as the specific number of characters to process regardless of whether the string contains a null-terminator before that. This causes confusion as it will happily read past the allocated array.
The definition should either be updated, or the implementation updated to break out of the loop when it encounters a null character.
Description
The
numparameter formeasureTextWidthis labelled as "max" characters when in actual fact it is used as the specific number of characters to process regardless of whether the string contains a null-terminator before that. This causes confusion as it will happily read past the allocated array.The definition should either be updated, or the implementation updated to break out of the loop when it encounters a null character.