changeset 17784:1b42df5780e3

name array is too small, use strlcpy instead of strncpy
author reimar
date Wed, 08 Mar 2006 21:13:16 +0000
parents 58fff521d376
children adc0e54034f0
files libmpdemux/demux_ty.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ty.c	Wed Mar 08 20:27:47 2006 +0000
+++ b/libmpdemux/demux_ty.c	Wed Mar 08 21:13:16 2006 +0000
@@ -158,7 +158,7 @@
 int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo )
 {
    char    header[ 512 ];
-   char    name[ 80 ];
+   char    name[ 100 ];
    char    sizestr[ 80 ];
    int     size;
    int     count;
@@ -201,8 +201,8 @@
          error = 1;
          break;
       }
-      strncpy( name, &header[ 0 ], 100 );
-      strncpy( sizestr, &header[ 124 ], 12 );
+      strlcpy( name, &header[ 0 ], 100 );
+      strlcpy( sizestr, &header[ 124 ], 12 );
       size = ty_octaltodecimal( sizestr );
 
       blocks = size / 512;