Permalink
Browse files

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.
  • Loading branch information...
1 parent 6df0403 commit fd5260f3cc67b284558d0cfcb89cb3b157c88e1a @syntheticpp syntheticpp committed Sep 18, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/build.h
View
@@ -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 {

0 comments on commit fd5260f

Please sign in to comment.