changeset 24448:044d3ec97bf7

Avoid strlcpy, tar headers already have space to ensure 0-termination
author reimar
date Fri, 14 Sep 2007 16:12:02 +0000
parents c6253f3b5f47
children 1007f99949af
files libmpdemux/demux_ty.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_ty.c	Fri Sep 14 16:04:12 2007 +0000
+++ b/libmpdemux/demux_ty.c	Fri Sep 14 16:12:02 2007 +0000
@@ -136,8 +136,8 @@
 static int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo )
 {
    char    header[ 512 ];
-   char    name[ 100 ];
-   char    sizestr[ 80 ];
+   char    *name;
+   char    *sizestr;
    int     size;
    int     count;
    int     blocks;
@@ -179,8 +179,10 @@
          error = 1;
          break;
       }
-      av_strlcpy( name, &header[ 0 ], 100 );
-      av_strlcpy( sizestr, &header[ 124 ], 12 );
+      name = header;
+      name[99] = 0;
+      sizestr = &header[124];
+      sizestr[12] = 0;
       size = strtol(sizestr, NULL, 8);
 
       blocks = size / 512;