From: FrantiÅ¡ek DvoÅák <va...@us...> - 2008-11-16 16:48:10
|
Update of /cvsroot/xine/xine-ui/src/xitk In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv26815/src/xitk Modified Files: skins_download.c Log Message: Skin download (fixed string concatention when local variables aren't zeroes). Less reallocs of the image data (fixed depth test). Index: skins_download.c =================================================================== RCS file: /cvsroot/xine/xine-ui/src/xitk/skins_download.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- skins_download.c 15 Nov 2008 23:59:53 -0000 1.5 +++ skins_download.c 16 Nov 2008 16:47:59 -0000 1.6 @@ -468,7 +468,7 @@ if((fd = fopen(tmpskin, "w+b")) != NULL) { char buffer[2048]; char fskin_path[XITK_PATH_MAX + 1]; - int i, skin_found = -1; + int i, skin_found = -1, len; fwrite(download.buf, download.size, 1, fd); fflush(fd); @@ -478,7 +478,10 @@ xine_system(0, buffer); unlink(tmpskin); - strncpy(buffer, filename, ((strlen(filename) + 1) - 7)); + len = strlen(filename) - strlen(".tar.gz"); + if (len > sizeof(buffer) - 1) len = sizeof(buffer) - 1; + strncpy(buffer, filename, len); + buffer[len] = '\0'; snprintf(fskin_path, sizeof(fskin_path), "%s/%s/%s", skindir, buffer, "doinst.sh"); if(is_a_file(fskin_path)) { |