summaryrefslogtreecommitdiff
path: root/apps/debug_menu.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-13 17:09:13 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-13 17:23:56 -0400
commit09785a8499b601abc9eac7640060c12eba962b56 (patch)
tree5ff5f1fa2e7f9927a9e45a7e1ca586bab93d7563 /apps/debug_menu.c
parentb94db707fb7a8ace5c8821ea47d85ec48ca48e26 (diff)
fix more yellow
Change-Id: I74bad58707d05ea167169d4315c05eb0cd1c8b7b
Diffstat (limited to 'apps/debug_menu.c')
-rw-r--r--apps/debug_menu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 44e56cdd02..7187e8135c 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -1521,13 +1521,16 @@ static int ata_smart_attr_to_string(
break;
case RAWFMT_RAW48:
- default:
+ default: {
+ uint32_t tmp;
+ memcpy(&tmp, w, sizeof(tmp));
/* shows first 4 bytes of raw data as uint32 LE,
and the ramaining 2 bytes as uint16 LE */
- len += snprintf(buf+len, size-len, "%lu", letoh32(*((uint32_t*)w)));
+ len += snprintf(buf+len, size-len, "%lu", letoh32(tmp));
if (w[2] && (len < size))
len += snprintf(buf+len, size-len, " %u", w[2]);
break;
+ }
}
/* ignore trailing \0 when truncated */
if (len >= size) len = size-1;