summaryrefslogtreecommitdiff
path: root/libgphoto2_port/serial/unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgphoto2_port/serial/unix.c')
-rw-r--r--libgphoto2_port/serial/unix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgphoto2_port/serial/unix.c b/libgphoto2_port/serial/unix.c
index 831ff4bdc..355ad869c 100644
--- a/libgphoto2_port/serial/unix.c
+++ b/libgphoto2_port/serial/unix.c
@@ -366,7 +366,7 @@ gp_port_library_list (GPPortInfoList *list)
gp_port_serial_unlock (NULL, path);
info.type = GP_PORT_SERIAL;
strncpy (info.path, "serial:", sizeof (info.path));
- strncat (info.path, path, sizeof (info.path));
+ strncat (info.path, path, sizeof (info.path) - strlen (info.path) - 1);
snprintf (info.name, sizeof (info.name),
_("Serial Port %i"), x);
CHECK (gp_port_info_list_append (list, info));