mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
NFC: Fix NDEF parser for MIFARE Classic (#4153)
* Add div() to API
* Revert "Add div() to API"
This reverts commit e03b5c4244.
* Use / and %
* NFC: More MFC NDEF fixes
* Simplify duplicated code in MFC data generator
* NFC: Print NDEF hex data with pretty format
* NFC: Consider NDEF strings with last \0 byte as text
* Pretty Format: Add padding to last line to keep table width
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
This commit is contained in:
@@ -36,11 +36,17 @@ void pretty_format_bytes_hex_canonical(
|
||||
}
|
||||
|
||||
const size_t begin_idx = i;
|
||||
const size_t end_idx = MIN(i + num_places, data_size);
|
||||
const size_t wrap_idx = i + num_places;
|
||||
const size_t end_idx = MIN(wrap_idx, data_size);
|
||||
|
||||
for(size_t j = begin_idx; j < end_idx; j++) {
|
||||
furi_string_cat_printf(result, "%02X ", data[j]);
|
||||
}
|
||||
if(end_idx < wrap_idx) {
|
||||
for(size_t j = end_idx; j < wrap_idx; j++) {
|
||||
furi_string_cat_printf(result, " ");
|
||||
}
|
||||
}
|
||||
|
||||
furi_string_push_back(result, '|');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user