diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 23:55:42 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 23:55:42 +0000 |
commit | 9bdf624636da3836c167ab6c53e60ade8fbce185 (patch) | |
tree | a23e9080cdf822efeaf3ea17fc7a5d18ad22c21b /base | |
parent | b49dbbfd58a34206876dd17ed023a2778d1ca28b (diff) | |
download | chromium_src-9bdf624636da3836c167ab6c53e60ade8fbce185.zip chromium_src-9bdf624636da3836c167ab6c53e60ade8fbce185.tar.gz chromium_src-9bdf624636da3836c167ab6c53e60ade8fbce185.tar.bz2 |
posix: avoid using printf when we're not sure of the types involved
It was totally bogus to pass char* to StringPrintf("%ls", ...).
I hate this code so much.
Review URL: http://codereview.chromium.org/271040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/command_line.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/base/command_line.cc b/base/command_line.cc index 0104f3b..bbd25b8 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -299,9 +299,11 @@ std::wstring CommandLine::program() const { // static std::wstring CommandLine::PrefixedSwitchString( const std::wstring& switch_string) { - return StringPrintf(L"%ls%ls", - kSwitchPrefixes[0], - switch_string.c_str()); +#if defined(OS_WIN) + return kSwitchPrefixes[0] + switch_string; +#else + return ASCIIToWide(kSwitchPrefixes[0]) + switch_string; +#endif } // static @@ -311,11 +313,13 @@ std::wstring CommandLine::PrefixedSwitchStringWithValue( return PrefixedSwitchString(switch_string); } - return StringPrintf(L"%ls%ls%ls%ls", - kSwitchPrefixes[0], - switch_string.c_str(), - kSwitchValueSeparator, - value_string.c_str()); + return PrefixedSwitchString(switch_string + +#if defined(OS_WIN) + kSwitchValueSeparator + +#else + ASCIIToWide(kSwitchValueSeparator) + +#endif + value_string); } #if defined(OS_WIN) |