summaryrefslogtreecommitdiff
path: root/backend/ricoh.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/ricoh.c
parent5bb4cf12855ec0151de15d6c5a2354ff08766957 (diff)
parent3dade5db2a37543f19f0967901d8d80a52a1e459 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/ricoh.c')
-rw-r--r--backend/ricoh.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/backend/ricoh.c b/backend/ricoh.c
index 58b3a53..fbe5c58 100644
--- a/backend/ricoh.c
+++ b/backend/ricoh.c
@@ -222,12 +222,14 @@ attach (const char *devnam, Ricoh_Device ** devp)
dev->sane.name = strdup (devnam);
dev->sane.vendor = "RICOH";
- 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";