libsepol: Use matching integer types in scope_write()
PATCH 1/1 libsepol: Use matching integer types in scope_write()
Since the variable "items" is used where a size_t is expected, just make it a size_t.
Since the variable "i" is compared to an uint32_t, just make it a uint32_t.
Signed-off-by James Carter <[email protected]>
--- libsepol/src/write.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
libsepol/src/write.c +2 -1
@@ -1947,7 +1947,8 @@ static int scope_write(hashtab_key_t key, hashtab_datum_t datum, void *ptr)struct policy_file *fp = pd->fp;uint32_t static_buf[32 ], *dyn_buf =NULL , *buf;size_t key_len =strlen (key); -unsigned int items =2 + scope->decl_ids_len, i; +size_t items =2 + scope->decl_ids_len; +uint32_t i;int rc; buf = static_buf;
Signature · 1 line
2.55.0
Quoted 8 lines · James Carter
Since the variable "items" is used where a
size_tis expected, just make it asize_t.Since the variable "i" is compared to an
uint32_t, just make it auint32_t.Signed-off-by James Carter <[email protected]>
Acked-by Stephen Smalley <[email protected]>
Quoted 6 lines · Stephen Smalley
Quoted 4 lines · James Carter
Since the variable "items" is used where a
size_tis expected, just make it asize_t.
Quoted 6 lines
Quoted 4 lines
Since the variable "i" is compared to an
uint32_t, just make it auint32_t.Signed-off-by James Carter <[email protected]>Acked-by Stephen Smalley <[email protected]>
Merged.
Thanks,
Jim