summaryrefslogtreecommitdiff
path: root/coreutils/stty.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2007-01-17 19:46:33 +0000
committerBernhard Reutner-Fischer2007-01-17 19:46:33 +0000
commit8eb0549e5dedcc379839e91cec70ddbee0dc8130 (patch)
treed99f91855a9cd1e17e2d73422a852a6aa1da1518 /coreutils/stty.c
parent94feb1c8076742c83f569a4e42405a70902066a0 (diff)
downloadbusybox-8eb0549e5dedcc379839e91cec70ddbee0dc8130.zip
busybox-8eb0549e5dedcc379839e91cec70ddbee0dc8130.tar.gz
- reuse return code of vsnprintf to avoid pulling in strlen
Diffstat (limited to 'coreutils/stty.c')
-rw-r--r--coreutils/stty.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 2682e96..69dee30 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -463,10 +463,10 @@ static void wrapf(const char *message, ...)
int buflen;
va_start(args, message);
- vsnprintf(buf, sizeof(buf), message, args);
+ buflen = vsnprintf(buf, sizeof(buf), message, args);
va_end(args);
- buflen = strlen(buf);
- if (!buflen) return;
+ /* buflen = strlen(buf); cheaper not to pull in strlen */
+ if (!buflen /*|| buflen >= sizeof(buf)*/) return;
if (current_col > 0) {
current_col++;