summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-05-18 20:20:02 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-05-18 20:20:02 +0000
commite809d748bcfe2db5c1ff59978b523237adc7426b (patch)
tree8ef354cf8c3cc43b75e2e5883b0e0d5cbac18c91 /libexec/ld.so
parentcf3b3ac3f586a01740892c6f2450a388e962b325 (diff)
make _dl_wrstderr() not call write per-character; ok drahn
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/util.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/libexec/ld.so/util.h b/libexec/ld.so/util.h
index ecc5efbff16..e5dee837b3f 100644
--- a/libexec/ld.so/util.h
+++ b/libexec/ld.so/util.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.h,v 1.20 2007/02/09 14:51:13 drahn Exp $ */
+/* $OpenBSD: util.h,v 1.21 2009/05/18 20:20:01 deraadt Exp $ */
/*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -54,10 +54,12 @@ long _dl_strtol(const char *nptr, char **endptr, int base);
static inline void
_dl_wrstderr(const char *s)
{
- while (*s) {
- _dl_write(2, s, 1);
- s++;
- }
+ const char *p = s;
+ size_t n = 0;
+
+ while (*p++)
+ n++;
+ _dl_write(2, s, n);
}
static inline void *