diff options
author | Peter Kümmel <syntheticpp@gmx.net> | 2012-09-18 07:14:39 (GMT) |
---|---|---|
committer | Peter Kümmel <syntheticpp@gmx.net> | 2012-09-18 07:14:39 (GMT) |
commit | fd5260f3cc67b284558d0cfcb89cb3b157c88e1a (patch) | |
tree | d310d9d14a7d23ab373c80186593da050e9c19a7 /src/build.h | |
parent | 6df040356f4e765e51f24857c7ef0f3ded4e6870 (diff) | |
download | Ninja-fd5260f3cc67b284558d0cfcb89cb3b157c88e1a.zip Ninja-fd5260f3cc67b284558d0cfcb89cb3b157c88e1a.tar.gz Ninja-fd5260f3cc67b284558d0cfcb89cb3b157c88e1a.tar.bz2 |
Fix subtile buffer size error
The deduced type was char* with size 4 and not char[32] with size 32.
This removes strange output characters on Windows.
Diffstat (limited to 'src/build.h')
-rw-r--r-- | src/build.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/build.h b/src/build.h index c94c8cc..8876d88 100644 --- a/src/build.h +++ b/src/build.h @@ -200,10 +200,10 @@ struct BuildStatus { /// The custom progress status format to use. const char* progress_status_format_; - template<class T> - void snprinfRate(double rate, T buf, const char* format) const { - if (rate == -1) snprintf(buf, sizeof(buf), "?"); - else snprintf(buf, sizeof(buf), format, rate); + template<size_t S> + void snprinfRate(double rate, char(&buf)[S], const char* format) const { + if (rate == -1) snprintf(buf, S, "?"); + else snprintf(buf, S, format, rate); } struct RateInfo { |