projects/aports·blob master · refs

49 lines · 1.5 KiB

1diff --git a/vmtbl.c b/vmtbl.c
2index 8fb6b90..09f4dc4 100644
3--- a/vmtbl.c
4+++ b/vmtbl.c
5@@ -18,6 +18,8 @@
6
7 #include "sc.h"
8
9+#define error(fmt, ...) printf(fmt, __VA_ARGS__)
10+
11 /*
12 * check to see if *rowp && *colp are currently allocated, if not expand the
13 * current size if we can.
14@@ -55,7 +57,7 @@ checkbounds(int *rowp, int *colp)
15 newptr = (type *)scxrealloc((char *)oldptr, \
16 (unsigned)(nelem * sizeof(type))); \
17 if (newptr == (type *)NULL) { \
18- error(msg); \
19+ error("%s", msg); \
20 return (FALSE); \
21 } \
22 oldptr = newptr /* wait incase we can't alloc */
23@@ -117,7 +119,7 @@ growtbl(int rowcol, int toprow, int topcol)
24 if ((rowcol == GROWCOL) || (rowcol == GROWBOTH)) {
25 if ((rowcol == GROWCOL) && ((maxcols == ABSMAXCOLS) ||
26 (topcol >= ABSMAXCOLS))) {
27- error(nowider);
28+ error("%s", nowider);
29 return (FALSE);
30 }
31
32@@ -172,7 +174,7 @@ growtbl(int rowcol, int toprow, int topcol)
33 for (i = 0; i < maxrows; i++) {
34 if ((tbl[i] = (struct ent **)scxrealloc((char *)tbl[i],
35 (unsigned)(newcols * sizeof(struct ent **)))) == (struct ent **)0) {
36- error(nowider);
37+ error("%s", nowider);
38 return(FALSE);
39 }
40 for (nullit = ATBL(tbl, i, maxcols), cnt = 0;
41@@ -190,7 +192,7 @@ growtbl(int rowcol, int toprow, int topcol)
42 for (; i < newrows; i++) {
43 if ((tbl[i] = (struct ent **)scxmalloc((unsigned)(newcols *
44 sizeof(struct ent **)))) == (struct ent **)0) {
45- error(nowider);
46+ error("%s", nowider);
47 return(FALSE);
48 }
49 for (nullit = tbl[i], cnt = 0; cnt < newcols; cnt++, nullit++)