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

Unified Diff: runtime/vm/version_in.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/timeline.cc ('k') | runtime/vm/zone.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/version_in.cc
diff --git a/runtime/vm/version_in.cc b/runtime/vm/version_in.cc
index 34d7fc6763701db67c3e3ce3b5f0b7b443751623..d19631078e11f4283de2842c6c7e91e1b5bb44f3 100644
--- a/runtime/vm/version_in.cc
+++ b/runtime/vm/version_in.cc
@@ -14,14 +14,9 @@ static const char* formatted_version = NULL;
const char* Version::String() {
if (formatted_version == NULL) {
- const char* format = "%s on \"%s_%s\"";
const char* os = OS::Name();
const char* arch = CPU::Id();
-
- intptr_t len = OS::SNPrint(NULL, 0, format, str_, os, arch);
- char* buffer = reinterpret_cast<char*>(malloc(len + 1));
- OS::SNPrint(buffer, (len + 1), format, str_, os, arch);
- formatted_version = buffer;
+ formatted_version = OS::SCreate(NULL, "%s on \"%s_%s\"", str_, os, arch);
}
return formatted_version;
}
« no previous file with comments | « runtime/vm/timeline.cc ('k') | runtime/vm/zone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698