[beast: 5/16] BST: avoid redundant use of mktemp



commit 59d17c310fdfd5fbb1cb2e4ee3e31d951b7f5809
Author: Tim Janik <timj gnu org>
Date:   Wed Sep 6 03:52:59 2017 +0200

    BST: avoid redundant use of mktemp
    
    Signed-off-by: Tim Janik <timj gnu org>

 beast-gtk/bstfiledialog.cc |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/beast-gtk/bstfiledialog.cc b/beast-gtk/bstfiledialog.cc
index 844fbf0..500e627 100644
--- a/beast-gtk/bstfiledialog.cc
+++ b/beast-gtk/bstfiledialog.cc
@@ -524,9 +524,7 @@ store_bse_file (Bse::ProjectH project, SfiProxy super_proxy, const String &file_
           while (error == Bse::Error::FILE_EXISTS)
             {
               g_free (temp_file);
-              temp_file = g_strdup_format ("%s.tmp%06xyXXXXXX", file_name, rand() & 0xfffffd);
-              char *result = mktemp (temp_file); /* this is save, due to use of: O_CREAT | O_EXCL */
-              (void) result;
+              temp_file = g_strdup_format ("%s.tmp%06x", file_name, rand() & 0xfffffd);
               error = project.store_bse (super, temp_file, self_contained);
             }
           /* replace file by temporary file */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]