File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -177,14 +177,15 @@ void dbgPrintVersion(void)
177
177
void dbgDumpMemory (void const *buf, uint8_t size, uint16_t count, bool printOffset)
178
178
{
179
179
uint8_t const *buf8 = (uint8_t const *) buf;
180
+
181
+ uint8_t format_size = 2 * size;
182
+ if ( count*size > UINT8_MAX ) offset_fmt_size *= 2 ;
183
+ if ( count*size > UINT16_MAX ) offset_fmt_size *= 2 ;
180
184
181
- char format[] = " %00lX" ;
182
- format[2 ] += 2 *size;
185
+ char format[] = " %02lX" ;
183
186
184
- char offset_fmt[] = " %02lX: " ;
185
-
186
- if ( count*size > UINT8_MAX ) format[2 ] *= 2 ;
187
- if ( count*size > UINT16_MAX ) format[2 ] *= 2 ;
187
+ char offset_fmt[] = " %00lX: " ;
188
+ offset_fmt[2 ] += offset_fmt_size;
188
189
189
190
const uint8_t item_per_line = 16 / size;
190
191
You can’t perform that action at this time.
0 commit comments