about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-09-01 16:38:36 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-09-01 16:38:36 +0200
commit833ffe26027512ec156dcc7bbdf78131165196cd (patch)
tree51b441bb858a4fb1475e417209159f350c01bef0
parentedc3e4f29ea1637ca0f48fcda1af791980348e4d (diff)
downloadredo-c-833ffe26027512ec156dcc7bbdf78131165196cd.tar.gz
redo-c-833ffe26027512ec156dcc7bbdf78131165196cd.tar.xz
redo-c-833ffe26027512ec156dcc7bbdf78131165196cd.zip
Put dofile into static buffer
-rw-r--r--redo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/redo.c b/redo.c
index 9d543db..781c828 100644
--- a/redo.c
+++ b/redo.c
@@ -201,7 +201,7 @@ redo_ifcreate(char *target)
 static char *
 check_dofile(const char *fmt, ...)
 {
-	char dofile[1024];
+	static char dofile[1024];
 
 	va_list ap;
 	va_start(ap, fmt);
@@ -209,7 +209,7 @@ check_dofile(const char *fmt, ...)
 	va_end(ap);
 
 	if (access (dofile, F_OK) == 0) {
-		return strdup(dofile);
+		return dofile;
 	} else {
 		redo_ifcreate(dofile);
 		return 0;