On Sat, Jan 9, 2021 at 7:08 PM Rafael J. Wysocki <rjw@xxxxxxxxxxxxx> wrote: > On Saturday, January 9, 2021 10:37:41 AM CET Dexuan Cui wrote: ... > > Do you want a simple strlen() check like the below, or a full > > check of the AAA#### or NNNN#### format? > > It would be good to check the format too while at it. Let me summarize. It seems from my perspective that the best is to have two checks here (as far as I got word "too" in Rafael's reply): - per length with a message that "length is exceeded" - per format with probably different messages depending on the checks (like "vendor prefix has incorrect format" and "device id has incorrect format"). -- With Best Regards, Andy Shevchenko