summaryrefslogtreecommitdiff
path: root/backend/fujitsu-scsi.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:10 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-12 17:36:10 +0100
commite0d94cf4d39395df1e2c6bb4d967200298c13881 (patch)
treebe5c7cace6697afc753c152d13ad5145d0884a42 /backend/fujitsu-scsi.h
parent527bedac30eb120915718eb7997e6dacd583512e (diff)
parent84357741a6a6e6430f199b2c3f7498e0e97da9ad (diff)
Update upstream source from tag 'upstream/1.2.1'
Update to upstream version '1.2.1' with Debian dir a9bb43f754a5c9a361b076af3635cc767b7e652e
Diffstat (limited to 'backend/fujitsu-scsi.h')
-rw-r--r--backend/fujitsu-scsi.h9
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 */