aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp
diff options
context:
space:
mode:
authorakhropov <akhropov@yandex-team.com>2024-01-31 18:01:36 +0300
committerakhropov <akhropov@yandex-team.com>2024-01-31 18:49:27 +0300
commit97ac585d7395d880e632f86d78b6ae333b6349e0 (patch)
treebb52a43b410f69025fa5cb9251a641e7c67247a0 /library/cpp
parent812e7e202ea3ff85db090a5c171e542a24f73c88 (diff)
downloadydb-97ac585d7395d880e632f86d78b6ae333b6349e0.tar.gz
sprintf -> snprintf as it is deprecated on macOS..
Diffstat (limited to 'library/cpp')
-rw-r--r--library/cpp/logger/global/rty_formater.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/cpp/logger/global/rty_formater.cpp b/library/cpp/logger/global/rty_formater.cpp
index f5035650c7..fab7c830bd 100644
--- a/library/cpp/logger/global/rty_formater.cpp
+++ b/library/cpp/logger/global/rty_formater.cpp
@@ -17,10 +17,10 @@ namespace {
struct tm tm;
instant.LocalTime(&tm);
- // both stftime and sprintf exclude the terminating null byte from the return value
+ // both stftime and snprintf exclude the terminating null byte from the return value
char* pos = begin;
pos += strftime(pos, end - pos, "%Y-%m-%d %H:%M:%S.", &tm);
- pos += sprintf(pos, "%03" PRIu32, instant.MilliSecondsOfSecond());
+ pos += snprintf(pos, end - pos, "%03" PRIu32, instant.MilliSecondsOfSecond());
pos += strftime(pos, end - pos, " %z", &tm);
Y_ABORT_UNLESS(LocalTimeSBufferSize - 1 == pos - begin); // together with Y_ABORT_UNLESS above this also implies pos<=end
return (pos - begin);