diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-02-12 17:36:29 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-02-12 17:36:29 +0100 |
commit | 882fd010527b8d8823f09e19edbed3746265fa08 (patch) | |
tree | be5c7cace6697afc753c152d13ad5145d0884a42 /backend/pie-scsidef.h | |
parent | 527bedac30eb120915718eb7997e6dacd583512e (diff) | |
parent | e0d94cf4d39395df1e2c6bb4d967200298c13881 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/pie-scsidef.h')
-rw-r--r-- | backend/pie-scsidef.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/backend/pie-scsidef.h b/backend/pie-scsidef.h index 05aa18f..9563452 100644 --- a/backend/pie-scsidef.h +++ b/backend/pie-scsidef.h @@ -189,9 +189,12 @@ static scsiblk inquiry = { inquiryC, sizeof(inquiryC) }; #define get_inquiry_additional_length(in) in[0x04] #define set_inquiry_length(out,n) out[0x04]=n-5 -#define get_inquiry_vendor(in, buf) strncpy(buf, in + 0x08, 0x08) -#define get_inquiry_product(in, buf) strncpy(buf, in + 0x10, 0x010) -#define get_inquiry_version(in, buf) strncpy(buf, in + 0x20, 0x04) +#define get_inquiry_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \ + 0x08, in + 0x08) +#define get_inquiry_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \ + 0x10, in + 0x10) +#define get_inquiry_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \ + 0x04, in + 0x20) #define get_inquiry_max_x_res(in) getnbyte1(in + 0x24, 2) #define get_inquiry_max_y_res(in) getnbyte1(in + 0x26, 2) |