Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: runtime/vm/coverage.cc

Issue 1331623002: Uses SNPRINT macro where possible. Otherwise uses #define for format. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: add missing include Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/benchmark_test.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/coverage.cc
diff --git a/runtime/vm/coverage.cc b/runtime/vm/coverage.cc
index d18ce19b9d0294e9617b9a0832aa464b8cc9dd72..82e7b547a3a753d50fdf69e648b350cf8fc1558f 100644
--- a/runtime/vm/coverage.cc
+++ b/runtime/vm/coverage.cc
@@ -247,13 +247,10 @@ void CodeCoverage::Write(Isolate* isolate) {
JSONStream stream;
PrintJSON(isolate, &stream, NULL, false);
- const char* format = "%s/dart-cov-%" Pd "-%" Pd64 ".json";
intptr_t pid = OS::ProcessId();
- intptr_t len = OS::SNPrint(NULL, 0, format,
- FLAG_coverage_dir, pid, isolate->main_port());
- char* filename = Thread::Current()->zone()->Alloc<char>(len + 1);
- OS::SNPrint(filename, len + 1, format,
- FLAG_coverage_dir, pid, isolate->main_port());
+ char* filename = OS::SCreate(Thread::Current()->zone(),
+ "%s/dart-cov-%" Pd "-%" Pd64 ".json",
+ FLAG_coverage_dir, pid, isolate->main_port());
void* file = (*file_open)(filename, true);
if (file == NULL) {
OS::Print("Failed to write coverage file: %s\n", filename);
« no previous file with comments | « runtime/vm/benchmark_test.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698