summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2017-05-30 01:17:17 +0300
committerJari Vetoniemi <mailroxas@gmail.com>2018-02-23 12:55:19 +0200
commitf37d6a105aec1110839fd257c612ca1445047ce0 (patch)
tree66c8a3c959edc2bbea697ee41d36dc6547fced40
parent8ab854ad168eeae80f1311fbfb43abb52a442f50 (diff)
xi2path: Cast before snprintf
Make sure results are unsigned Found by cppcheck
-rw-r--r--src/bin/xi/xi2path.h2
1 files changed, 1 insertions, 1 deletions
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