From 7e94383861a80fa877381a59941b71f52ae6e8e5 Mon Sep 17 00:00:00 2001 From: eyck Date: Thu, 13 Feb 2003 09:34:37 +0000 Subject: [PATCH] Fix for string handling bug from Alex Beregszasz git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9413 b3059339-0415-0410-9bf9-f77b7e298cf2 --- drivers/mga_vid.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/mga_vid.c b/drivers/mga_vid.c index e5d7f141c5..871463ce88 100644 --- a/drivers/mga_vid.c +++ b/drivers/mga_vid.c @@ -1416,14 +1416,14 @@ static void mga_param_buff_fill( void ) { unsigned len; len = 0; - len += sprintf(&mga_param_buff[len],"Interface version: %04X\n",MGA_VID_VERSION); - len += sprintf(&mga_param_buff[len],"Memory: %x:%dM\n",mga_mem_base,(unsigned int) mga_ram_size); - len += sprintf(&mga_param_buff[len],"MMIO: %p\n",mga_mmio_base); - len += sprintf(&mga_param_buff[len],"Configurable stuff:\n"); - len += sprintf(&mga_param_buff[len],"~~~~~~~~~~~~~~~~~~~\n"); - len += sprintf(&mga_param_buff[len],PARAM_BRIGHTNESS"%d\n",mga_brightness); - len += sprintf(&mga_param_buff[len],PARAM_CONTRAST"%d\n",mga_contrast); - len += sprintf(&mga_param_buff[len],PARAM_BLACKIE"%s\n",regs.blackie?"on":"off"); + len += sprintf(&mga_param_buff[len]-len,"Interface version: %04X\n",MGA_VID_VERSION); + len += sprintf(&mga_param_buff[len]-len,"Memory: %x:%dM\n",mga_mem_base,(unsigned int) mga_ram_size); + len += sprintf(&mga_param_buff[len]-len,"MMIO: %p\n",mga_mmio_base); + len += sprintf(&mga_param_buff[len]-len ,"Configurable stuff:\n"); + len += sprintf(&mga_param_buff[len]-len,"~~~~~~~~~~~~~~~~~~~\n"); + len += sprintf(&mga_param_buff[len]-len,PARAM_BRIGHTNESS"%d\n",mga_brightness); + len += sprintf(&mga_param_buff[len]-len,PARAM_CONTRAST"%d\n",mga_contrast); + len += sprintf(&mga_param_buff[len]-len,PARAM_BLACKIE"%s\n",regs.blackie?"on":"off"); mga_param_buff_len = len; // check boundaries of mga_param_buff before writing to it!!! }