Re: [PATCH v3] HID: wacom: replace sprintf calls with safer alternatives in wacom_sys.c
From: Nehuen Lian Bova
Date: Sat Nov 07 2026 - 20:25:03 EST
> If you're going through the effort to use snprintf the string, you
> might as well also read its return value to check to check for
> truncation (return value greater than or equal to size) and handle
> such an error condition appropriately.
>
> Jason (she/they)
I didn't check the return value because I noticed in almost every
situation snprintf() is used, the return value wasn't checked.
Anyway, would be a good idea to return -ENAMETOOLONG after
checking if return value >= sizeof(bat_name)?
Or using scnprintf() instead of snprintf() could be a cleaner option?
:)
--
Nehuen Lian Bova