Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTetsuo Kiso <tetsuo-s@is.naist.jp>2012-04-18 18:47:48 +0400
committerTetsuo Kiso <tetsuo-s@is.naist.jp>2012-04-18 18:47:48 +0400
commitfe79b96328c3aadf034529427b21d98be03aab77 (patch)
treec2b9e6c6ce71ea5ec4bb9e993ffbe7bf3d0eee39 /mert/Data.cpp
parentfd5defdb4faf41846049c8cb369c4db2106d8d16 (diff)
Use std::stringstream instead of using snprintf() for Windows.
This commit fixes compilation problems related to snprintf() for Windows users. Thanks to Raka Prasetya for reporting the errors. Thanks also to Kenneth Heafield and Barry Haddow for suggestions.
Diffstat (limited to 'mert/Data.cpp')
-rw-r--r--mert/Data.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/mert/Data.cpp b/mert/Data.cpp
index 5405b0cb9..be4c65fb2 100644
--- a/mert/Data.cpp
+++ b/mert/Data.cpp
@@ -173,15 +173,15 @@ void Data::InitFeatureMap(const string& str) {
string features = "";
string tmp_name = "";
size_t tmp_index = 0;
- char tmp[64]; // for snprintf();
while (!buf.empty()) {
getNextPound(buf, substr);
// string ending with ":" are skipped, because they are the names of the features
if (!EndsWith(substr, ":")) {
- snprintf(tmp, sizeof(tmp), "%s_%lu ", tmp_name.c_str(), tmp_index);
- features.append(tmp);
+ stringstream ss;
+ ss << tmp_name << "_" << tmp_index << " ";
+ features.append(ss.str());
tmp_index++;
} else if (substr.find("_") != string::npos) {