englebass pushed a commit to branch master.

commit f854efd041b816553d0710dd0fd5d7372144443c
Author: Sebastian Dransfeld <[email protected]>
Date:   Wed Aug 7 10:18:59 2013 +0200

    efreet: Use mkstemp for tempfile
    
    CID: #1039615
---
 src/bin/efreet/efreetd.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index 66ca956..fd4e8a0 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -26,13 +26,15 @@ quit(void)
 int
 main(int argc, char *argv[])
 {
-   char buf[PATH_MAX];
-   char *path;
+   char path[PATH_MAX];
    FILE *log;
 
-   strcpy(buf, "/tmp/efreetd_XXXXXX");
-   path = mktemp(buf);
-   if (!path) return 1;
+   strcpy(path, "/tmp/efreetd_XXXXXX");
+   if (mkstemp(path) < 0)
+     {
+        perror("mkstemp");
+        return 1;
+     }
    if (chmod(path, 0700) < 0)
      {
         perror("chmod");

-- 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

Reply via email to