Came across the need to parse non-standard NMEA token lengths (thank you ST, for making non-standard NMEA tokens). I updated your code to include a parameter to allow longer than usual tokens.
Only potential problem comes in the strnwcmp function. To allow for varying lengths, I added a break condition. If either string reports a null character (end of string), the function now assumes the strings are equivalent. This could be removed if the code which calls strnwcmp calculated the token length, instead of just defaulting to maximum length, but for this limited application, this workaround works well.
Came across the need to parse non-standard NMEA token lengths (thank you ST, for making non-standard NMEA tokens). I updated your code to include a parameter to allow longer than usual tokens.
Only potential problem comes in the strnwcmp function. To allow for varying lengths, I added a break condition. If either string reports a null character (end of string), the function now assumes the strings are equivalent. This could be removed if the code which calls strnwcmp calculated the token length, instead of just defaulting to maximum length, but for this limited application, this workaround works well.