[MPlayer-cvslog] r36600 - trunk/libvo/vo_bl.c

reimar subversion at mplayerhq.hu
Sat Jan 18 14:05:50 CET 2014


Author: reimar
Date: Sat Jan 18 14:05:50 2014
New Revision: 36600

Log:
vo_bl: Use snprintf.

Modified:
   trunk/libvo/vo_bl.c

Modified: trunk/libvo/vo_bl.c
==============================================================================
--- trunk/libvo/vo_bl.c	Sat Jan 18 13:59:25 2014	(r36599)
+++ trunk/libvo/vo_bl.c	Sat Jan 18 14:05:50 2014	(r36600)
@@ -366,10 +366,11 @@ static int preinit(const char *arg) {
 	}
 	if (i >= NO_BLS) {
 		txt[0] = 0;
-		for (i = 0; i < NO_BLS; i++)
-			if (strlen( txt ) + 4 + strlen( bls[i].name ) + 1 < sizeof(txt))
-				sprintf( txt + strlen( txt ), "%s%s",
+		for (i = 0; i < NO_BLS; i++) {
+			int pos = strlen(txt);
+			snprintf(txt + pos, sizeof(txt) - pos, "%s%s",
 					 txt[0] == 0 ? "" : i == NO_BLS - 1 ? " or " : ", ", bls[i].name );
+		}
 		mp_msg(MSGT_VO, MSGL_ERR, "bl: subdevice must start with %s\nbl: i.e. -vo bl:arcade:host=localhost:2323\n", txt);
 		return 1;
 	}


More information about the MPlayer-cvslog mailing list