diff options
author | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-01-17 19:46:33 +0000 |
---|---|---|
committer | aldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-01-17 19:46:33 +0000 |
commit | d38414c95f0b08f95aaadb3fed0ec0cd864df68a (patch) | |
tree | d99f91855a9cd1e17e2d73422a852a6aa1da1518 | |
parent | 05e0f15f1c3ccc63ca265dfe7274b7c95cbb8808 (diff) | |
download | busybox-w32-d38414c95f0b08f95aaadb3fed0ec0cd864df68a.tar.gz busybox-w32-d38414c95f0b08f95aaadb3fed0ec0cd864df68a.tar.bz2 busybox-w32-d38414c95f0b08f95aaadb3fed0ec0cd864df68a.zip |
- reuse return code of vsnprintf to avoid pulling in strlen
git-svn-id: svn://busybox.net/trunk/busybox@17354 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | coreutils/stty.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c index 2682e969d..69dee30b3 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c | |||
@@ -463,10 +463,10 @@ static void wrapf(const char *message, ...) | |||
463 | int buflen; | 463 | int buflen; |
464 | 464 | ||
465 | va_start(args, message); | 465 | va_start(args, message); |
466 | vsnprintf(buf, sizeof(buf), message, args); | 466 | buflen = vsnprintf(buf, sizeof(buf), message, args); |
467 | va_end(args); | 467 | va_end(args); |
468 | buflen = strlen(buf); | 468 | /* buflen = strlen(buf); cheaper not to pull in strlen */ |
469 | if (!buflen) return; | 469 | if (!buflen /*|| buflen >= sizeof(buf)*/) return; |
470 | 470 | ||
471 | if (current_col > 0) { | 471 | if (current_col > 0) { |
472 | current_col++; | 472 | current_col++; |