# HG changeset patch # User reimar # Date 1390050350 0 # Node ID edc2020f7bf4a3304a428729e27113be4b844276 # Parent 2545bbe7d845ae8d3939b9373cb36a94799cf304 vo_bl: Use snprintf. diff -r 2545bbe7d845 -r edc2020f7bf4 libvo/vo_bl.c --- a/libvo/vo_bl.c Sat Jan 18 12:59:25 2014 +0000 +++ b/libvo/vo_bl.c Sat Jan 18 13:05:50 2014 +0000 @@ -366,10 +366,11 @@ } 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; }