]> git.ozlabs.org Git - ccan/commitdiff
noerr: don't use tempnam
authorRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 1 Mar 2011 12:49:20 +0000 (23:19 +1030)
We run in a temporary directory now.  Also, avoids warning and memory leak.

ccan/noerr/test/run.c

index aeef1ca835841881b6fb6e1bded76d96d4d148d8..503ba81c52fe74e3f48b2a40d54bb9288e9b9d71 100644 (file)
@@ -9,8 +9,7 @@
 
 int main(int argc, char *argv[])
 {
 
 int main(int argc, char *argv[])
 {
-       /* tempnam(3) is generally a bad idea, but OK here. */
-       char *name = tempnam(NULL, "noerr");
+       char *name = "noerr.file";
        int fd;
        FILE *fp;
 
        int fd;
        FILE *fp;