summaryrefslogtreecommitdiff
path: root/backend/kodak-cmd.h
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-02-12 17:35:53 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-02-12 17:35:53 +0100
commit84357741a6a6e6430f199b2c3f7498e0e97da9ad (patch)
tree23e8d66ede9506b94c76fb36910ca3c7dd15c74e /backend/kodak-cmd.h
parent302276dc1b90cfc972fb726ca94a23b18f4b0088 (diff)
New upstream version 1.2.1upstream/1.2.1
Diffstat (limited to 'backend/kodak-cmd.h')
-rw-r--r--backend/kodak-cmd.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/backend/kodak-cmd.h b/backend/kodak-cmd.h
index 7d5d506..17e353c 100644
--- a/backend/kodak-cmd.h
+++ b/backend/kodak-cmd.h
@@ -133,10 +133,14 @@ putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes)
#define get_I_cmdque(in) getbitfield(in + 7, 1, 1)
#define get_I_sftre(in) getbitfield(in + 7, 0, 1)
-#define get_I_vendor(in, buf) strncpy(buf,(char *)in + 0x08, 0x08)
-#define get_I_product(in, buf) strncpy(buf,(char *)in + 0x10, 0x10)
-#define get_I_version(in, buf) strncpy(buf,(char *)in + 0x20, 0x04)
-#define get_I_build(in, buf) strncpy(buf,(char *)in + 0x24, 0x02)
+#define get_I_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
+ 0x08, (char *)in + 0x08)
+#define get_I_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
+ 0x10, (char *)in + 0x10)
+#define get_I_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
+ 0x04, (char *)in + 0x20)
+#define get_I_build(in, buf) snprintf(buf, 0x02 + 1, "%.*s", \
+ 0x02, (char *)in + 0x24)
#define get_I_mf_disable(in) getbitfield(in + 38, 7, 1)
#define get_I_checkdigit(in) getbitfield(in + 38, 6, 1)