changeset 23602:a7dc7b4c1401

pstrcpy -> av_strlcpy
author reimar
date Sun, 24 Jun 2007 08:39:40 +0000
parents 0f1c9cf1752d
children c1221a031ab7
files libmpdemux/muxer_lavf.c
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_lavf.c	Sun Jun 24 08:14:10 2007 +0000
+++ b/libmpdemux/muxer_lavf.c	Sun Jun 24 08:39:40 2007 +0000
@@ -22,6 +22,7 @@
 #else
 #include "avformat.h"
 #endif
+#include "libavutil/avstring.h"
 
 extern const struct AVCodecTag *mp_wav_taglists[];
 extern const struct AVCodecTag *mp_bmp_taglists[];
@@ -34,8 +35,6 @@
 extern char *info_sourceform;
 extern char *info_comment;
 
-void pstrcpy(char *buf, int buf_size, const char *str);
-
 typedef struct {
 	//AVInputFormat *avif;
 	AVFormatContext *oc;
@@ -396,15 +395,15 @@
         priv->oc->preload= (int)(mux_preload*AV_TIME_BASE);
         priv->oc->max_delay= (int)(mux_max_delay*AV_TIME_BASE);
         if (info_name)
-            pstrcpy(priv->oc->title    , sizeof(priv->oc->title    ), info_name     );
+            av_strlcpy(priv->oc->title    , info_name,      sizeof(priv->oc->title    ));
         if (info_artist)
-            pstrcpy(priv->oc->author   , sizeof(priv->oc->author   ), info_artist   );
+            av_strlcpy(priv->oc->author   , info_artist,    sizeof(priv->oc->author   ));
         if (info_genre)
-            pstrcpy(priv->oc->genre    , sizeof(priv->oc->genre    ), info_genre    );
+            av_strlcpy(priv->oc->genre    , info_genre,     sizeof(priv->oc->genre    ));
         if (info_copyright)
-            pstrcpy(priv->oc->copyright, sizeof(priv->oc->copyright), info_copyright);
+            av_strlcpy(priv->oc->copyright, info_copyright, sizeof(priv->oc->copyright));
         if (info_comment)
-            pstrcpy(priv->oc->comment  , sizeof(priv->oc->comment  ), info_comment  );
+            av_strlcpy(priv->oc->comment  , info_comment,   sizeof(priv->oc->comment  ));
 	register_protocol(&mp_protocol);
 
 	if(url_fopen(&priv->oc->pb, mp_filename, URL_WRONLY))