Avoid strlcpy, tar headers already have space to ensure 0-termination

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24468 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-09-14 16:12:02 +00:00
parent 97f633a083
commit d85a609547
1 changed files with 6 additions and 4 deletions

View File

@ -136,8 +136,8 @@ static int ty_extensionis(const char *name, const char *ext )
static int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo ) static int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo )
{ {
char header[ 512 ]; char header[ 512 ];
char name[ 100 ]; char *name;
char sizestr[ 80 ]; char *sizestr;
int size; int size;
int count; int count;
int blocks; int blocks;
@ -179,8 +179,10 @@ static int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo )
error = 1; error = 1;
break; break;
} }
av_strlcpy( name, &header[ 0 ], 100 ); name = header;
av_strlcpy( sizestr, &header[ 124 ], 12 ); name[99] = 0;
sizestr = &header[124];
sizestr[12] = 0;
size = strtol(sizestr, NULL, 8); size = strtol(sizestr, NULL, 8);
blocks = size / 512; blocks = size / 512;