Closed mgrzeschik closed 3 years ago
This brings back the warnings about comparing signed and unsigned ints.
I'm not sure what the correct way of handling this is TBH.
-- bye, pabs
I would merge it. So at least its equally wrong to the rest of the libusbgx stack. As second step we could add an patch over the whole tree, that fixes the comparison between sizeof and int by casting one of the sides.
OK, sounds good.
This RedHat blog post covers printf truncation:
https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8
It suggests these options:
I'll leave it to you to decide which of those is best, but personally I would choose 3 > 4 > 1 > 2.
-- bye, pabs
I will now look into the blogpost and cook a patch.
Since snprintf returns int not unsigned we change the type of nmb.
Signed-off-by: Michael Grzeschik m.grzeschik@pengutronix.de