diff options
author | babenko <babenko@yandex-team.com> | 2022-09-19 16:59:49 +0300 |
---|---|---|
committer | babenko <babenko@yandex-team.com> | 2022-09-19 16:59:49 +0300 |
commit | ddbed3bdc9fbfec40475f0e3939187bb6ce716c3 (patch) | |
tree | e761fd77c2f6fb80c4edcd47d66d6356bdd71fcb /library/cpp/yt/string/format-inl.h | |
parent | b5a861d056d17322efb73efb580e0d32238e452c (diff) | |
download | ydb-ddbed3bdc9fbfec40475f0e3939187bb6ce716c3.tar.gz |
Sane handling of %x and %X for pointers in Format
Diffstat (limited to 'library/cpp/yt/string/format-inl.h')
-rw-r--r-- | library/cpp/yt/string/format-inl.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/library/cpp/yt/string/format-inl.h b/library/cpp/yt/string/format-inl.h index c437d7ab34..a6a15485eb 100644 --- a/library/cpp/yt/string/format-inl.h +++ b/library/cpp/yt/string/format-inl.h @@ -462,6 +462,11 @@ void FormatIntValue( TStringBuf format, TStringBuf genericSpec); +void FormatPointerValue( + TStringBuilderBase* builder, + const void* value, + TStringBuf format); + } // namespace NDetail #define XX(valueType, castType, genericSpec) \ @@ -501,7 +506,7 @@ XX(float, float, TStringBuf("f")) template <class T> void FormatValue(TStringBuilderBase* builder, T* value, TStringBuf format) { - NYT::NDetail::FormatValueViaSprintf(builder, static_cast<const void*>(value), format, TStringBuf("p")); + NYT::NDetail::FormatPointerValue(builder, static_cast<const void*>(value), format); } // TDuration (specialize for performance reasons) |