summaryrefslogtreecommitdiff
path: root/src/input/vcd
diff options
context:
space:
mode:
authorMatthias Hopf <mat@mshopf.de>2006-12-08 16:26:10 +0000
committerMatthias Hopf <mat@mshopf.de>2006-12-08 16:26:10 +0000
commit4169f9efdaeda8a60b5cfd464bd39b80a9dd2032 (patch)
treefc007ba74c24176b7772442ddf9433242df16ad7 /src/input/vcd
parent3321b7ae77daede398739a832e75c5dfba7de22e (diff)
downloadxine-lib-4169f9efdaeda8a60b5cfd464bd39b80a9dd2032.tar.gz
xine-lib-4169f9efdaeda8a60b5cfd464bd39b80a9dd2032.tar.bz2
Fix wrong length specification for strncat() calls.
Consolidated multiple strncat() calls to snprintf(). CVS patchset: 8407 CVS date: 2006/12/08 16:26:10
Diffstat (limited to 'src/input/vcd')
-rw-r--r--src/input/vcd/libcdio/iso9660_fs.c8
-rw-r--r--src/input/vcd/libvcd/vcd.c6
2 files changed, 6 insertions, 8 deletions
diff --git a/src/input/vcd/libcdio/iso9660_fs.c b/src/input/vcd/libcdio/iso9660_fs.c
index 0a2de8fa1..fff12cd7c 100644
--- a/src/input/vcd/libcdio/iso9660_fs.c
+++ b/src/input/vcd/libcdio/iso9660_fs.c
@@ -1,5 +1,5 @@
/*
- $Id: iso9660_fs.c,v 1.6 2006/09/28 08:19:14 dgp85 Exp $
+ $Id: iso9660_fs.c,v 1.7 2006/12/08 16:26:10 mshopf Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003, 2004 Rocky Bernstein <rocky@panix.com>
@@ -51,7 +51,7 @@
#include <stdio.h>
-static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.6 2006/09/28 08:19:14 dgp85 Exp $";
+static const char _rcsid[] = "$Id: iso9660_fs.c,v 1.7 2006/12/08 16:26:10 mshopf Exp $";
/* Implementation of iso9660_t type */
struct _iso9660 {
@@ -1200,9 +1200,7 @@ find_fs_lsn_recurse (CdIo *p_cdio, const char pathname[], lsn_t lsn)
char _fullname[4096] = { 0, };
char *filename = (char *) statbuf->filename;
- snprintf (_fullname, sizeof (_fullname), "%s%s", pathname, filename);
-
- strncat (_fullname, "/", sizeof (_fullname));
+ snprintf (_fullname, sizeof (_fullname), "%s%s/", pathname, filename);
if (statbuf->type == _STAT_DIR
&& strcmp ((char *) statbuf->filename, ".")
diff --git a/src/input/vcd/libvcd/vcd.c b/src/input/vcd/libvcd/vcd.c
index e9618a7d7..0772149ec 100644
--- a/src/input/vcd/libvcd/vcd.c
+++ b/src/input/vcd/libvcd/vcd.c
@@ -1,5 +1,5 @@
/*
- $Id: vcd.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
+ $Id: vcd.c,v 1.4 2006/12/08 16:26:10 mshopf Exp $
Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
@@ -49,7 +49,7 @@
#include "util.h"
#include "vcd.h"
-static const char _rcsid[] = "$Id: vcd.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
+static const char _rcsid[] = "$Id: vcd.c,v 1.4 2006/12/08 16:26:10 mshopf Exp $";
static const char zero[CDIO_CD_FRAMESIZE_RAW] = { 0, };
@@ -1664,7 +1664,7 @@ _write_sequence (VcdObj *obj, int track_idx)
track->info->ahdr[i].bitrate / 1024,
_mode_str[track->info->ahdr[i].mode]);
- strncat (buf2, buf, sizeof(buf));
+ strncat (buf2, buf, sizeof(buf2) - strlen(buf2) - 1);
}
vcd_info ("writing track %d, %s, %s, %s...", track_idx + 2,