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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
$NetBSD: patch-ae,v 1.2 2002/02/18 23:49:08 mycroft Exp $
--- frontend/scanimage.c.orig Sat Feb 16 12:54:39 2002
+++ frontend/scanimage.c Sat Feb 16 13:06:23 2002
@@ -64,6 +64,9 @@
}
Image;
+
+void damn_i386_centric_vprintf(const char *, const char **);
+
#define OPTION_FORMAT 1001
#define OPTION_MD5 1002
#define OPTION_BATCH_COUNT 1003
@@ -1561,8 +1564,8 @@
}
start = percent;
}
- vprintf(fmt, arglist);
- va_end(arglist);
+ damn_i386_centric_vprintf(fmt, arglist);
+ free(arglist);
}
}
@@ -1910,3 +1913,35 @@
return status;
}
+
+void damn_i386_centric_vprintf(const char *fmt, const char **arglist)
+ {
+ int c;
+
+ while(c = *fmt++)
+ {
+ switch(c)
+ {
+ case '%':
+ switch(*fmt++)
+ {
+ case 'i':
+ fprintf(stdout, "%d", (int) *arglist++);
+ break;
+ case 's':
+ fputs(*arglist++, stdout);
+ break;
+ case '%':
+ default:
+ fputc('%', stdout);
+ break;
+ }
+ break;
+
+ default:
+ fputc(c, stdout);
+ break;
+ }
+ }
+ }
+
|