diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-11-16 00:14:35 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-11-16 00:14:35 +0000 |
commit | 92f8eae34fb3c6dd9dfd43515f7f8de4f9be5a80 (patch) | |
tree | 2202a528fadebe723c9da372b2df31edbf000073 /usr.bin | |
parent | a10f6190ba6db430fc9e77272b10ed18102691a2 (diff) |
Fix undefined behavior (var = ++var).
From Alexey Dobriyan <adobriyan at gmail dot com>.
OK otto@, moritz@, and jaredy@.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/sort/init.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/sort/init.c b/usr.bin/sort/init.c index 2cf8c1a9ebd..31049abbdcd 100644 --- a/usr.bin/sort/init.c +++ b/usr.bin/sort/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.8 2005/04/11 07:12:03 deraadt Exp $ */ +/* $OpenBSD: init.c,v 1.9 2006/11/16 00:14:34 ray Exp $ */ /*- * Copyright (c) 1993 @@ -36,7 +36,7 @@ #if 0 static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 6/6/93"; #else -static char rcsid[] = "$OpenBSD: init.c,v 1.8 2005/04/11 07:12:03 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: init.c,v 1.9 2006/11/16 00:14:34 ray Exp $"; #endif #endif /* not lint */ @@ -123,7 +123,8 @@ setcolumn(char *pos, struct field *cur_fld, int gflag) if (*pos == '.') { if (!col->num) errx(2, "cannot indent end of line"); - pos += sscanf(++pos, "%d", &(col->indent)); + pos++; + pos += sscanf(pos, "%d", &(col->indent)); while (isdigit(*pos)) pos++; if (&cur_fld->icol == col) |