diff options
author | Camil Staps | 2015-08-24 12:04:01 +0200 |
---|---|---|
committer | Camil Staps | 2015-08-24 12:04:01 +0200 |
commit | 14e0a65dee44af822911ba32d140c7801306252e (patch) | |
tree | 927fbd609c72737f49ef997a9b5b6bb4a89313d3 | |
parent | Fixing clipping mode (diff) |
Fixes for temporary file handling in WinCreateBitmap
-rw-r--r-- | Linux_C_12/cpicture_121.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Linux_C_12/cpicture_121.c b/Linux_C_12/cpicture_121.c index 4b08fea..07f85f3 100644 --- a/Linux_C_12/cpicture_121.c +++ b/Linux_C_12/cpicture_121.c @@ -11,6 +11,7 @@ #include "util_121.h"
#include <pango/pango.h>
#include <pango/pangoft2.h>
+#include <errno.h>
#include "cpicture_121.h"
#include "cCrossCall_121.h"
#include "cCrossCallWindows_121.h"
@@ -1172,13 +1173,16 @@ void WinCreateBitmap (CLEAN_STRING data, GdkDrawable *inDraw,OS ios, printf("WinCreateBitmap\n");
- char* tempfile = "/tmp/bitmapXXXXXX";
- int tempfh = mkstemp(tempfile);
+ char tempfile[23];
+ rscopy(tempfile, "/tmp/bitmap.XXXXXX.bmp");
+ int tempfh = mkstemps(tempfile,4);
+ int errsv = errno;
if (tempfh == -1) {
- printf("Couldn't create temporary file.\n");
+ printf("Couldn't create temporary file - %d\n", errsv);
exit(1);
}
write(tempfh, cdata, CleanStringLength(data));
+ free(cdata);
InitGTK();
*bitmap = gdk_pixbuf_new_from_file(tempfile, &err);
|