changeset 30346:a88a4507e2cf

Replace strncat by av_strlcat which is easier to verify for correctness.
author reimar
date Fri, 22 Jan 2010 21:16:54 +0000
parents ea015e0ab0c6
children 2f4948cd9a2a
files subreader.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Fri Jan 22 21:10:40 2010 +0000
+++ b/subreader.c	Fri Jan 22 21:16:54 2010 +0000
@@ -20,6 +20,7 @@
 #include "subreader.h"
 #include "stream/stream.h"
 #include "libavutil/common.h"
+#include "libavutil/avstring.h"
 
 #ifdef CONFIG_ENCA
 #include <enca.h>
@@ -990,8 +991,7 @@
 		    if (!stream_read_line(st, directive, LINE_LEN))
 			return NULL;
 		    trail_space(directive);
-		    strncat(line2, directive,
-			    (LINE_LEN > 511) ? LINE_LEN : 511);
+		    av_strlcat(line2, directive, LINE_LEN);
 		    break;
 		}
 	    default: