X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fdevices%2Fops.c;h=7b5f1c7e78c776bb0e8d95aa475132541253abf2;hb=e4687b3aa2aed49fb16ba9e9561344d808750297;hp=e5e19af02a53356cb08fbcb19eb4b711e057d25e;hpb=b93de056e0b79f57c8f8fe22985b166c7d2c3dc3;p=swftools.git diff --git a/lib/devices/ops.c b/lib/devices/ops.c index e5e19af..7b5f1c7 100644 --- a/lib/devices/ops.c +++ b/lib/devices/ops.c @@ -21,8 +21,11 @@ #include #include #include +#ifndef WIN32 #include +#endif #include +#include #include "../types.h" #include "../mem.h" #include "../gfxdevice.h" @@ -43,7 +46,7 @@ static void dbg(char*format, ...) int l; va_list arglist; va_start(arglist, format); - vsprintf(buf, format, arglist); + vsnprintf(buf, sizeof(buf)-1, format, arglist); va_end(arglist); l = strlen(buf); while(l && buf[l-1]=='\n') { @@ -157,7 +160,9 @@ void ops_endpage(struct _gfxdevice*dev) gfxresult_t* ops_finish(struct _gfxdevice*dev) { - free(dev->internal);dev->internal = 0; + if(dev->internal) + free(dev->internal); + dev->internal = 0; return 0; }