commit 46d92fa93b69db578945a18f1463ec940df19fb3
parent e67ceebfe8a9ab42a871a44455a052c9b07c9c71
Author: Claudio Alessi <smoppy@gmail.com>
Date: Sat, 23 Apr 2016 20:31:04 +0200
Remove the temp file.
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/myadm.c b/myadm.c
@@ -288,7 +288,7 @@ ecalloc(size_t nmemb, size_t size) {
char *
editbuf(char *in, int len, int *sz) {
Arg a;
- char tmp[] = "myadm.XXXXXX";
+ char tmp[] = "myadm.XXXXXX", *buf;
int fd;
fd = mkstemp(tmp);
@@ -302,7 +302,9 @@ editbuf(char *in, int len, int *sz) {
wait(NULL);
curs_set(1); curs_set(0); /* XXX Investigate... */
ui_redraw();
- return fget(tmp, sz);
+ buf = fget(tmp, sz);
+ unlink(tmp);
+ return buf;
}
void