Commit 6459bd2
committed
fix: Correct printf format specifiers for unsigned integers
This commit addresses cppcheck warnings about mismatched printf format
specifiers (invalidPrintfArgType_sint). The format specifiers %i and %d
expect signed integers (int) but the variables being passed are unsigned
integers (uint32_t, unsigned). This mismatch can lead to undefined behavior
and incorrect output formatting.
Changes made:
- utils/kmstouch.cpp: Changed %i to %u for event code formatting
- utils/kmstouch.cpp: Changed %d to %u for event type and property type formatting
- utils/kmsview.cpp: Changed %d to %u for frame number formatting
These fixes ensure proper type safety in printf formatting and prevent
potential undefined behavior when printing unsigned integer values.1 parent 21755e6 commit 6459bd2
2 files changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
0 commit comments