Skip to content
Commit 37e444c8 authored by Daniel M German's avatar Daniel M German Committed by Felipe Balbi
Browse files

usb: Replace snprintf with scnprintf in gether_get_ifname

snprintf returns the actual length of the buffer created; however,
this is not the case if snprintf truncates its parameter.
See https://lwn.net/Articles/69419/

 for a detailed explanation.
The current code correctly handles this case at the expense
of extra code in the return statement.

scnprintf does returns the actual length of the buffer created
making the ?: operator unnecessary in the return
statement.

This change does not alter the functionality of the code.

Signed-off-by: default avatarDaniel M German <dmg@turingmachine.org>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent d29fcf70
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment