From f37d6a105aec1110839fd257c612ca1445047ce0 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Tue, 30 May 2017 01:17:17 +0300 Subject: xi2path: Cast before snprintf Make sure results are unsigned Found by cppcheck --- src/bin/xi/xi2path.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bin/xi') diff --git a/src/bin/xi/xi2path.h b/src/bin/xi/xi2path.h index 954c554..d31e4ed 100644 --- a/src/bin/xi/xi2path.h +++ b/src/bin/xi/xi2path.h @@ -16,7 +16,7 @@ xi2path(char out[12], const uint16_t id) // In the above graph, 'R' bits form the ROM section (7) and 'D' bits form the DAT (104). // Thus maximum DAT and ROM section IDs are 127 and 511 respectively (65535 as decimal). - snprintf(out, 12, "%u/%u.DAT", id >> 7, id & 0x7F); + snprintf(out, 12, "%u/%u.DAT", (uint8_t)(id >> 7), (uint16_t)(id & 0x7F)); } static inline void -- cgit v1.2.3