]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: 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)
commit9cc16ef0acd7253c7696a80cffdd0a18d99d5cd0
tree7c23714769dc5f6937db888a645bd81821371df4
parentf5589e70c6d48215b784fab1bdfa9723765fc9b8
libkmod: 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>
libkmod/libkmod-index.c