From: Daniel Caujolle-B. <f1...@us...> - 2004-03-26 09:22:22
|
Update of /cvsroot/xine/xine-ui/src/xitk/xine-toolkit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8704/xine-toolkit Modified Files: label.c Log Message: hidden 'loop of death'(TM) fix Index: label.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/label.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- label.c 29 Jan 2004 22:19:52 -0000 1.60 +++ label.c 26 Mar 2004 09:11:25 -0000 1.61 @@ -47,7 +47,7 @@ private_data->anim_offset = 0; if(private_data->animation) { - _label = (char *) alloca((strlen(private_data->label) * 2) + 5 + 1); + _label = (char *) xitk_xmalloc((strlen(private_data->label) * 2) + 5 + 1); if((strlen(private_data->label)) > private_data->length) sprintf(_label, "%s *** %s", private_data->label, private_data->label); @@ -56,24 +56,22 @@ } else - xitk_strdupa(_label, private_data->label); + _label = strdup(private_data->label); len = strlen(_label); pixwidth = private_data->char_length * ((private_data->length * ((len / private_data->length) + 1)) + 5); - private_data->labelpix = xitk_image_create_xitk_pixmap(private_data->imlibdata, (pixwidth) ? pixwidth : 1, private_data->char_height); x_dest = 0; - - for (i = 0; i < pixwidth; i++) { + + for (i = 0; i < strlen(_label); i++) { int c = 0; if ((i < len) && (_label[i] >= 32)) c = _label[i] - 32; - if (c >= 0) { int px, py; @@ -91,6 +89,7 @@ x_dest += private_data->char_length; } + free(_label); } /* |