summaryrefslogtreecommitdiff
path: root/backend/sp15c-scsi.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:29 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:29 +0100
commit882fd010527b8d8823f09e19edbed3746265fa08 (patch)
treebe5c7cace6697afc753c152d13ad5145d0884a42 /backend/sp15c-scsi.h
parent527bedac30eb120915718eb7997e6dacd583512e (diff)
parente0d94cf4d39395df1e2c6bb4d967200298c13881 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/sp15c-scsi.h')
-rw-r--r--backend/sp15c-scsi.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/backend/sp15c-scsi.h b/backend/sp15c-scsi.h
index 1d3e0a1..03fee55 100644
--- a/backend/sp15c-scsi.h
+++ b/backend/sp15c-scsi.h
@@ -209,9 +209,12 @@ static scsiblk inquiryB =
#define get_IN_response_format(in) getbitfield(in + 0x03, 0x0f, 0)
#define IN_recognized 0x02
#define get_IN_additional_length(in) in[0x04]
-#define get_IN_vendor(in, buf) strncpy(buf, in + 0x08, 0x08)
-#define get_IN_product(in, buf) strncpy(buf, in + 0x10, 0x010)
-#define get_IN_version(in, buf) strncpy(buf, in + 0x20, 0x04)
+#define get_IN_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
+ 0x08, in + 0x08)
+#define get_IN_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
+ 0x10, in + 0x10)
+#define get_IN_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
+ 0x04, in + 0x20)
#define get_IN_color_mode(in) getbitfield(in + 0x24, 0xf, 0)
#define get_IN_color_seq(in) getbitfield(in + 0x24, 0x7, 4)
#define get_IN_adf(in) getbitfield(in + 0x24, 0x1, 7)