git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
numerous bigfixes in stroke->polygon conversion
[swftools.git]
/
lib
/
devices
/
ops.c
diff --git
a/lib/devices/ops.c
b/lib/devices/ops.c
index
e5e19af
..
7b5f1c7
100644
(file)
--- a/
lib/devices/ops.c
+++ b/
lib/devices/ops.c
@@
-21,8
+21,11
@@
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
+#ifndef WIN32
#include <unistd.h>
#include <unistd.h>
+#endif
#include <memory.h>
#include <memory.h>
+#include <string.h>
#include "../types.h"
#include "../mem.h"
#include "../gfxdevice.h"
#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);
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') {
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)
{
gfxresult_t* ops_finish(struct _gfxdevice*dev)
{
- free(dev->internal);dev->internal = 0;
+ if(dev->internal)
+ free(dev->internal);
+ dev->internal = 0;
return 0;
}
return 0;
}