summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/input/input_http.c21
-rw-r--r--src/input/libdvdnav/remap.c7
-rw-r--r--src/input/vcd/libcdio/iso9660_fs.c8
-rw-r--r--src/input/vcd/libvcd/vcd.c6
-rw-r--r--src/libsputext/demux_sputext.c5
-rw-r--r--src/libw32dll/wine/module.c4
6 files changed, 20 insertions, 31 deletions
diff --git a/src/input/input_http.c b/src/input/input_http.c
index 0ba143091..9011fba7f 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -19,7 +19,7 @@
*
* input plugin for http network streams
*
- * $Id: input_http.c,v 1.124 2006/11/30 10:54:18 dgp85 Exp $
+ * $Id: input_http.c,v 1.125 2006/12/08 16:26:10 mshopf Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -335,12 +335,9 @@ static int http_plugin_read_metainf (http_input_plugin_t *this) {
/* prepares the event */
radio = _x_meta_info_get(this->stream, XINE_META_INFO_ALBUM);
if (radio) {
- int len = strlen(radio);
- strncpy(data.str, radio, sizeof(data.str));
- strncat(data.str, " - ", sizeof(data.str) - len);
- strncat(data.str, songtitle, sizeof(data.str) - len - 3);
+ snprintf (data.str, sizeof(data.str), "%s - %s", radio, songtitle);
} else {
- strncpy(data.str, songtitle, sizeof(data.str));
+ strncpy(data.str, songtitle, sizeof(data.str)-1);
}
data.str[sizeof(data.str) - 1] = '\0';
data.str_len = strlen(data.str) + 1;
@@ -766,13 +763,11 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
}
snprintf(this->buf + buflen, BUFSIZE - buflen,
- "User-Agent: xine/%s\015\012", VERSION);
- buflen = strlen(this->buf);
- strncat (this->buf, "Accept: */*\015\012", BUFSIZE - buflen);
- buflen = strlen(this->buf);
- strncat (this->buf, "Icy-MetaData: 1\015\012", BUFSIZE - buflen);
- buflen = strlen(this->buf);
- strncat (this->buf, "\015\012", BUFSIZE - buflen);
+ "User-Agent: xine/%s\015\012"
+ "Accept: */*\015\012"
+ "Icy-MetaData: 1\015\012"
+ "\015\012",
+ VERSION);
buflen = strlen(this->buf);
if (_x_io_tcp_write (this->stream, this->fh, this->buf, buflen) != buflen) {
_x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "couldn't send request", NULL);
diff --git a/src/input/libdvdnav/remap.c b/src/input/libdvdnav/remap.c
index 86cf3a4ad..f2049ac06 100644
--- a/src/input/libdvdnav/remap.c
+++ b/src/input/libdvdnav/remap.c
@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: remap.c,v 1.5 2006/09/17 13:01:08 valtri Exp $
+ * $Id: remap.c,v 1.6 2006/12/08 16:26:10 mshopf Exp $
*/
#include <stdlib.h>
@@ -193,10 +193,7 @@ remap_t* remap_loadmap( char *title) {
/* Build the map filename */
home = getenv("HOME"); assert(home);
- strncpy(fname, home, sizeof(fname));
- strncat(fname, "/.dvdnav/", sizeof(fname));
- strncat(fname, title, sizeof(fname));
- strncat(fname, ".map", sizeof(fname));
+ snprintf (fname, sizeof(fname), "%s/.dvdnav/%s.map", home, title);
/* Open the map file */
fp = fopen( fname, "r");
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,
diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c
index d5c591212..db0b826de 100644
--- a/src/libsputext/demux_sputext.c
+++ b/src/libsputext/demux_sputext.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: demux_sputext.c,v 1.49 2006/07/10 22:08:30 dgp85 Exp $
+ * $Id: demux_sputext.c,v 1.50 2006/12/08 16:26:10 mshopf Exp $
*
* code based on old libsputext/xine_decoder.c
*
@@ -915,7 +915,8 @@ static subtitle_t *sub_read_line_jacobsub(demux_sputext_t *this, subtitle_t *cur
return NULL;
trail_space(directive);
strncat(line2, directive,
- (LINE_LEN > 511) ? LINE_LEN : 511);
+ ((LINE_LEN > 511) ? LINE_LEN-1 : 511)
+ - strlen(line2));
break;
}
default:
diff --git a/src/libw32dll/wine/module.c b/src/libw32dll/wine/module.c
index 6e9235584..c37073d18 100644
--- a/src/libw32dll/wine/module.c
+++ b/src/libw32dll/wine/module.c
@@ -389,9 +389,7 @@ HMODULE WINAPI LoadLibraryExA(LPCSTR libname, HANDLE hfile, DWORD flags)
strncpy(path, libname, sizeof(path) - 1);
} else {
/* check default user path */
- strncpy(path, win32_def_path, sizeof(path) - 2);
- strcat(path, "/");
- strncat(path, libname, sizeof(path) - strlen(libname));
+ snprintf(path, sizeof(path), "%s/%s", win32_def_path, libname);
}
wm = MODULE_LoadLibraryExA( path, hfile, flags );