diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-02-16 10:20:08 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-02-16 10:20:08 +0100 |
commit | 778ebf8ee9cb22ea5727844333bcd5a6ee6bc0de (patch) | |
tree | a754e785b286ed82b45fe4e50b980714ad80e0a7 /backend/fujitsu-scsi.h | |
parent | 7d8aac1f3634dc58785bec7acf097dd6bac8c394 (diff) | |
parent | 32cb765f681299af226ca0520993cbe47ba5ecd0 (diff) |
Merge branch 'release/debian/1.2.1-1'debian/1.2.1-1
Diffstat (limited to 'backend/fujitsu-scsi.h')
-rw-r--r-- | backend/fujitsu-scsi.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/backend/fujitsu-scsi.h b/backend/fujitsu-scsi.h index 3d3cf07..c7616f7 100644 --- a/backend/fujitsu-scsi.h +++ b/backend/fujitsu-scsi.h @@ -140,9 +140,12 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) #define IN_periph_devtype_unknown 0x1f #define get_IN_response_format(in) getbitfield(in + 0x03, 0x07, 0) #define IN_recognized 0x02 -#define get_IN_vendor(in, buf) strncpy(buf, (char *)in + 0x08, 0x08) -#define get_IN_product(in, buf) strncpy(buf, (char *)in + 0x10, 0x010) -#define get_IN_version(in, buf) strncpy(buf, (char *)in + 0x20, 0x04) +#define get_IN_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \ + 0x08, (char *)in + 0x08) +#define get_IN_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \ + 0x10, (char *)in + 0x10) +#define get_IN_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \ + 0x04, (char *)in + 0x20) #define get_IN_color_offset(in) getnbyte (in+0x2A, 2) /* offset between colors */ /* these only in some scanners */ |