aboutsummaryrefslogtreecommitdiff
path: root/tran.c
diff options
context:
space:
mode:
Diffstat (limited to 'tran.c')
-rw-r--r--tran.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tran.c b/tran.c
index d659cfa..4efaa21 100644
--- a/tran.c
+++ b/tran.c
@@ -344,7 +344,7 @@ void funnyvar(Cell *vp, const char *rw)
if (vp->tval & FCN)
FATAL("can't %s %s; it's a function.", rw, vp->nval);
WARNING("funny variable %p: n=%s s=\"%s\" f=%g t=%o",
- vp, vp->nval, vp->sval, vp->fval, vp->tval);
+ (void *)vp, vp->nval, vp->sval, vp->fval, vp->tval);
}
char *setsval(Cell *vp, const char *s) /* set string val of a Cell */
@@ -516,6 +516,17 @@ char *tostring(const char *s) /* make a copy of string s */
return(p);
}
+char *tostringN(const char *s, size_t n) /* make a copy of string s */
+{
+ char *p;
+
+ p = malloc(n);
+ if (p == NULL)
+ FATAL("out of space in tostring on %s", s);
+ strcpy(p, s);
+ return(p);
+}
+
Cell *catstr(Cell *a, Cell *b) /* concatenate a and b */
{
Cell *c;