]> git.ipfire.org Git - thirdparty/kmod.git/commit
depmod: use uint8_t for the child prefix/index
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 16 Nov 2024 15:20:42 +0000 (15:20 +0000)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 22 Nov 2024 21:31:15 +0000 (15:31 -0600)
commitf5589e70c6d48215b784fab1bdfa9723765fc9b8
tree2f33079fb6971e9c171290e1e609169a69e04010
parent3f8f288020e00ba2b52429e42fc27483029f87a6
depmod: use uint8_t for the child prefix/index

Stop implicitly casting the child prefix/index to int. It can have high
bits set thus get promoted to wildly incorrect value and cause chaos
further on.

In addition, convert the existing `unsigned char` instances to uint8_t,
which better illustrates what we're after - a fixed sized 8 bit unsigned
integer.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/251
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
tools/depmod.c