diff options
author | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-10-23 00:24:25 +0000 |
---|---|---|
committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2016-10-23 00:24:25 +0000 |
commit | ab1717bb35d85041e0184f79daa1313a1306dc01 (patch) | |
tree | fa0739f76b49b902269f8f7c1e1c7c5ea30c0556 /pic/misc.c | |
parent | aa7798c94fa57f6c00fab4393c9fe91334864371 (diff) |
Notes
Diffstat (limited to 'pic/misc.c')
-rw-r--r-- | pic/misc.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/pic/misc.c b/pic/misc.c index 4aa9b06d5c4c..73ea3d7db771 100644 --- a/pic/misc.c +++ b/pic/misc.c @@ -93,8 +93,8 @@ double getcomp(obj *p, int t) /* return component of a position */ return 0; } -double exprlist[100]; -int nexpr = 0; +static double exprlist[100]; +static int nexpr = 0; void exprsave(double f) { @@ -177,16 +177,13 @@ void printpos(obj *p) /* print position for debugging */ printf("%g, %g\n", p->o_x, p->o_y); } -char *tostring(char *s) +char *tostring(const char *s) { - register char *p; - size_t l; + char *p; - l = strlen(s)+1; - p = malloc(l); + p = strdup(s); if (p == NULL) FATAL("out of space in tostring on %s", s); - n_strcpy(p, s, l); return(p); } |