summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkstailey <kstailey@openbsd.org>1997-01-21 23:57:37 +0000
committerkstailey <kstailey@openbsd.org>1997-01-21 23:57:37 +0000
commitf8e2282a7ebca74df31d7aebaf5501fbd4362f21 (patch)
treefdc48e151c76c3f90f9023eecccc4e2fd20a999a
parentoptimization: kill two calls to strlen() in format() (diff)
downloadwireguard-openbsd-f8e2282a7ebca74df31d7aebaf5501fbd4362f21.tar.xz
wireguard-openbsd-f8e2282a7ebca74df31d7aebaf5501fbd4362f21.zip
back out 1.4; I should know better than to do this after a big meal
-rw-r--r--usr.bin/awk/run.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/awk/run.c b/usr.bin/awk/run.c
index 71a4fcac9b0..35c41aeb251 100644
--- a/usr.bin/awk/run.c
+++ b/usr.bin/awk/run.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: run.c,v 1.4 1997/01/21 23:47:55 kstailey Exp $ */
+/* $OpenBSD: run.c,v 1.5 1997/01/21 23:57:37 kstailey Exp $ */
/****************************************************************
Copyright (C) AT&T and Lucent Technologies 1996
All Rights Reserved
@@ -791,7 +791,8 @@ int format(char *buf, int bufsize, char *s, Node *a)
a = a->nnext;
switch (flag) {
case 0: sprintf((char *)p, "%s", fmt); /* unknown, so dump it too */
- p += len += strlen(p);
+ len += strlen(p);
+ p += strlen(p);
sprintf((char *)p, "%s", getsval(x));
break;
case 1: sprintf((char *)p, (char *)fmt, getfval(x)); break;
@@ -814,7 +815,8 @@ int format(char *buf, int bufsize, char *s, Node *a)
break;
}
tempfree(x);
- p += len += strlen(p);
+ len += strlen(p);
+ p += strlen(p);
s++;
}
*p = '\0';