summaryrefslogtreecommitdiff
path: root/stdio-common/bug4.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/bug4.c')
-rw-r--r--stdio-common/bug4.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stdio-common/bug4.c b/stdio-common/bug4.c
index 00abf3c502..acf5b5433b 100644
--- a/stdio-common/bug4.c
+++ b/stdio-common/bug4.c
@@ -14,6 +14,7 @@ DEFUN(main, (argc, argv),
FILE *f;
int i;
char buffer[31];
+ const char filename[] = "/tmp/bugtest";
while ((i = getopt (argc, argv, "rw")) != EOF)
switch (i)
@@ -26,7 +27,7 @@ DEFUN(main, (argc, argv),
break;
}
- f = fopen("/tmp/bugtest", "w+");
+ f = fopen(filename, "w+");
for (i=0; i<9000; i++) {
putc('x', f);
}
@@ -36,6 +37,7 @@ DEFUN(main, (argc, argv),
fread(buffer, 1, 31, f);
fwrite(buffer, 1, 31, stdout);
fclose(f);
+ remove(filename);
if (!memcmp (buffer, "Where does this text come from?", 31))
{