1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
$NetBSD: patch-al,v 1.1 2005/10/05 11:45:46 salo Exp $
Fix for SA17008, from Gentoo.
--- ../convert/vidtoppm.c.orig 1995-01-20 04:25:40.000000000 +0100
+++ ../convert/vidtoppm.c 2005-10-05 13:16:27.000000000 +0200
@@ -220,9 +220,11 @@
sprintf(ofname, "%s%d.ppm", obase, i);
- outFile = fopen("/tmp/foobar", "w");
+ sprintf(tempfile, "%s%d.ppm.tmp", obase, i);
+ outFile = fopen(tempfile, "w");
if (!outFile) {
perror("Couldn't open output file.");
+ exit(1);
}
for (r=0; r<height; r++) {
@@ -238,8 +240,9 @@
free(tdata);
- sprintf(command, "rawtoppm %d %d < /tmp/foobar > %s",
- width, height, ofname);
+ sprintf(command, "rawtoppm %d %d < %s > %s",
+ width, height, tempfile, ofname);
system(command);
+ unlink(tempfile);
}
}
|