str_open_as_stream() doesn't need a real file either.
authorColin Leroy <colin@colino.net>
Wed, 10 Oct 2018 08:22:09 +0000 (10:22 +0200)
committerColin Leroy <colin@colino.net>
Wed, 10 Oct 2018 08:22:09 +0000 (10:22 +0200)
src/common/file-utils.c

index e4d7a5e..392821e 100644 (file)
@@ -872,7 +872,10 @@ FILE *str_open_as_stream(const gchar *str)
 
        cm_return_val_if_fail(str != NULL, NULL);
 
-       fp = my_tmpfile();
+       len = strlen(str);
+
+       fp = my_tmpfile_with_len(len);
+
        if (!fp) {
                FILE_OP_ERROR("str_open_as_stream", "my_tmpfile");
                return NULL;