summaryrefslogtreecommitdiff
path: root/backend/ibm.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-02-02 17:14:32 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-02-02 17:14:32 +0100
commit5dadc28ea784db1ba1f56c2ea8618d2db67af1c8 (patch)
tree808b2499b54563b3290f34d70d159b1024310873 /backend/ibm.c
parent5bb4cf12855ec0151de15d6c5a2354ff08766957 (diff)
parent3dade5db2a37543f19f0967901d8d80a52a1e459 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/ibm.c')
-rw-r--r--backend/ibm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/backend/ibm.c b/backend/ibm.c
index e527a04..1f26226 100644
--- a/backend/ibm.c
+++ b/backend/ibm.c
@@ -248,12 +248,14 @@ attach (const char *devnam, Ibm_Device ** devp)
dev->sane.name = strdup (devnam);
dev->sane.vendor = "IBM";
- str = malloc (sizeof(ibuf.product) + sizeof(ibuf.revision) + 1);
+
+ size_t prod_rev_size = sizeof(ibuf.product) + sizeof(ibuf.revision) + 1;
+ str = malloc (prod_rev_size);
if (str)
{
- str[0] = '\0';
- strncat (str, (char *)ibuf.product, sizeof(ibuf.product));
- strncat (str, (char *)ibuf.revision, sizeof(ibuf.revision));
+ snprintf (str, prod_rev_size, "%.*s%.*s",
+ (int) sizeof(ibuf.product), (const char *) ibuf.product,
+ (int) sizeof(ibuf.revision), (const char *) ibuf.revision);
}
dev->sane.model = str;
dev->sane.type = "flatbed scanner";