diff --git a/doc/index.html b/doc/index.html
index 11c24b35..a84ae802 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -137,6 +137,7 @@
diff --git a/src/hilight.c b/src/hilight.c
index b4a84303..1035cab8 100644
--- a/src/hilight.c
+++ b/src/hilight.c
@@ -2254,13 +2254,13 @@ void print_hilight_net(int show)
prepare_netlist_structs(1); /* use full prepare_netlist_structs(1) to recognize pin direction */
/* when creating pins from hilight nets 20171221 */
- if(!(fd = open_tmpfile("hilight2_", &filename_ptr)) ) {
+ if(!(fd = open_tmpfile("hilight2_", "", &filename_ptr)) ) {
fprintf(errfp, "print_hilight_net(): can not create tmpfile %s\n", filename_ptr);
return;
}
my_strdup(_ALLOC_ID_, &filetmp2, filename_ptr);
fclose(fd);
- if(!(fd = open_tmpfile("hilight1_", &filename_ptr))) {
+ if(!(fd = open_tmpfile("hilight1_", "", &filename_ptr))) {
fprintf(errfp, "print_hilight_net(): can not create tmpfile %s\n", filename_ptr);
my_free(_ALLOC_ID_, &filetmp2);
return;
diff --git a/src/psprint.c b/src/psprint.c
index 8d8581be..00393055 100644
--- a/src/psprint.c
+++ b/src/psprint.c
@@ -1093,7 +1093,7 @@ void create_ps(char **psfile, int what, int fullzoom, int eps)
}
if(what & 1) { /* prolog */
numpages = 0;
- if(!(fd = open_tmpfile("psplot_", psfile)) ) {
+ if(!(fd = open_tmpfile("psplot_", ".ps", psfile)) ) {
fprintf(errfp, "ps_draw(): can not create tmpfile %s\n", *psfile);
return;
}
diff --git a/src/save.c b/src/save.c
index a5a3517e..d69b2bee 100644
--- a/src/save.c
+++ b/src/save.c
@@ -943,7 +943,7 @@ int raw_read_from_attr(Raw **rawptr, const char *type, double sweep1, double swe
size_t length;
if(i->prop_ptr && (b64_spice_data = get_tok_value(i->prop_ptr, "spice_data", 0))[0]) {
length = strlen(b64_spice_data);
- if( (fd = open_tmpfile("embedded_rawfile_", &tmp_filename)) ) {
+ if( (fd = open_tmpfile("embedded_rawfile_", ".raw", &tmp_filename)) ) {
s = base64_decode(b64_spice_data, length, &decoded_length);
fwrite(s, decoded_length, 1, fd);
fclose(fd);
@@ -2301,14 +2301,14 @@ const char *create_tmpdir(char *prefix)
/* after 5 unsuccessfull attemps give up */
/* and return NULL */
/* */
-FILE *open_tmpfile(char *prefix, char **filename)
+FILE *open_tmpfile(char *prefix, char *suffix, char **filename)
{
static char str[PATH_MAX]; /* safe even with multiple schematics, if immediately copied */
int i;
FILE *fd;
struct stat buf;
for(i=0; i<5; ++i) {
- my_snprintf(str, S(str), "%s%s", tclgetvar("XSCHEM_TMP_DIR"), random_string(prefix));
+ my_snprintf(str, S(str), "%s%s%s", tclgetvar("XSCHEM_TMP_DIR"), random_string(prefix), suffix);
*filename = str;
if(stat(str, &buf) && (fd = fopen(str, "w")) ) { /* file must not exist */
dbg(1, "open_tmpfile(): created file: %s\n", str);
diff --git a/src/xschem.h b/src/xschem.h
index 86bb2de3..3bd47b21 100644
--- a/src/xschem.h
+++ b/src/xschem.h
@@ -1741,7 +1741,7 @@ extern int pending_events(void);
#endif
extern void get_square(double x, double y, int *xx, int *yy);
extern const char *create_tmpdir(char *prefix);
-extern FILE *open_tmpfile(char *prefix, char **filename);
+extern FILE *open_tmpfile(char *prefix, char *suffix, char **filename);
extern void create_ps(char** psfile, int what, int fullzoom, int eps);
extern void MyXCopyArea(Display* display, Drawable src, Drawable dest, GC gc, int src_x, int src_y, unsigned int width, unsigned int height, int dest_x, int dest_y);
#endif /*CADGLOBALS */
|