diff options
author | Jason McIntyre <jmc@cvs.openbsd.org> | 2006-11-04 19:10:16 +0000 |
---|---|---|
committer | Jason McIntyre <jmc@cvs.openbsd.org> | 2006-11-04 19:10:16 +0000 |
commit | 9c36d0f3a2312d0802978bbc731b0223e5d0a88d (patch) | |
tree | 6b436163e7ae92ec47fed96772f326ad6319f062 /usr.bin | |
parent | d146a02f1c6f75d42e07dd4c61ea38cc8d66c862 (diff) |
from ru@freebsd:
Fix a bug converting a variable from the numeric type to a string.
ok otto deraadt
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/awk/tran.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/awk/tran.c b/usr.bin/awk/tran.c index 288288637ce..b8e42a75c6f 100644 --- a/usr.bin/awk/tran.c +++ b/usr.bin/awk/tran.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tran.c,v 1.13 2005/04/15 15:54:26 millert Exp $ */ +/* $OpenBSD: tran.c,v 1.14 2006/11/04 19:10:15 jmc Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -333,10 +333,10 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */ donerec = 1; } t = tostring(s); /* in case it's self-assign */ - vp->tval &= ~NUM; - vp->tval |= STR; if (freeable(vp)) xfree(vp->sval); + vp->tval &= ~NUM; + vp->tval |= STR; vp->tval &= ~DONTFREE; dprintf( ("setsval %p: %s = \"%s (%p) \", t=%o r,f=%d,%d\n", vp, NN(vp->nval), t,t, vp->tval, donerec, donefld) ); |