diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2023-06-27 20:23:44 +1000 |
commit | 332983c97b7a729c4dc5f19aa9ee4a22c420f7d8 (patch) | |
tree | fd9c441b796b522bdd5c7f8fbd32f51b8eff2a28 /source/utility/word_count.cpp | |
parent | 14b9689b6d4f4ad5276c88130dc6e449bedc0709 (diff) |
The Formatting String Catastrophe
Diffstat (limited to 'source/utility/word_count.cpp')
-rw-r--r-- | source/utility/word_count.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/utility/word_count.cpp b/source/utility/word_count.cpp index 683a3a9..d233b8c 100644 --- a/source/utility/word_count.cpp +++ b/source/utility/word_count.cpp @@ -31,7 +31,7 @@ int main(int argc, char** argv) { if (json.isNull()) continue; - String countKey = wordCountKey ? *wordCountKey : strf(".%s files", type); + String countKey = wordCountKey ? *wordCountKey : strf(".{} files", type); wordCounts[countKey] += countFunction(json); } }; @@ -178,14 +178,14 @@ int main(int argc, char** argv) { int totalWordCount = 0; for (auto countPair : wordCounts) { - coutf("%d words in %s\n", countPair.second, countPair.first); + coutf("{} words in {}\n", countPair.second, countPair.first); totalWordCount += countPair.second; } - coutf("approximately %s words total\n", totalWordCount); + coutf("approximately {} words total\n", totalWordCount); return 0; } catch (std::exception const& e) { - cerrf("exception caught: %s\n", outputException(e, true)); + cerrf("exception caught: {}\n", outputException(e, true)); return 1; } } |