From 3dc2bd79377fe2dac65eee0c55f9199e3a6b6805 Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Sun, 16 Oct 2016 07:53:23 +0000 Subject: [PATCH 1/2] i think that we can do this...as we'd just be overwriting if the last slot is actually full --- .../src/shared/core/DbBindableString.h | 9 ++++----- .../src/shared/core/DbBindableUnicode.h | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableString.h b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableString.h index 7a1d2e04..c9552f0c 100755 --- a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableString.h +++ b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableString.h @@ -254,12 +254,11 @@ namespace DB if (bufsize >= S) { WARNING(true, ("Attmpted to insert %s which is too long. Truncating.", buffer)); indicator = S; - memcpy(m_value, buffer, indicator-1); } else { indicator = bufsize; - memcpy(m_value, buffer, indicator); } + memcpy(m_value, buffer, indicator); m_value[indicator] = '\0'; } @@ -274,10 +273,10 @@ namespace DB memcpy(m_value, Unicode::wideToNarrow(buffer).c_str(), indicator-1); } else { indicator = bufsize; - memcpy(m_value, Unicode::wideToNarrow(buffer).c_str(), indicator); } - m_value[indicator] = '\0'; + memcpy(m_value, Unicode::wideToNarrow(buffer).c_str(), indicator); + m_value[indicator] = '\0'; } template @@ -288,12 +287,12 @@ namespace DB if (bufsize >= S) { WARNING(true, ("Attmpted to insert %s which is too long. Truncating.", buffer.c_str())); indicator = S; - memcpy(m_value, buffer.c_str(), indicator-1); } else { indicator = bufsize; memcpy(m_value, buffer.c_str(), indicator); } + memcpy(m_value, buffer.c_str(), indicator); m_value[indicator] = '\0'; } diff --git a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableUnicode.h b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableUnicode.h index fba31be0..d8c761fc 100755 --- a/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableUnicode.h +++ b/engine/shared/library/sharedDatabaseInterface/src/shared/core/DbBindableUnicode.h @@ -200,12 +200,11 @@ namespace DB if (bufsize >= S) { WARNING(true, ("Attmpted to insert %s which is too long. Truncating.", buffer.c_str())); indicator = S; - memcpy(m_value, str.c_str(), indicator-1); } else { indicator = bufsize; - memcpy(m_value, str.c_str(), indicator); } - + + memcpy(m_value, str.c_str(), indicator); m_value[indicator] = '\0'; } From db22dd3089a95652f0a1de40a02a492e4cf2bfbd Mon Sep 17 00:00:00 2001 From: DarthArgus Date: Mon, 17 Oct 2016 17:05:43 +0000 Subject: [PATCH 2/2] add description for master --- README.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..aa84c47c --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +master - stable, but internal only +testing - bleeding edge, works in progress, internal only +clang-profile - intenal, modified to profile the code for clang-profile-build +clang-profile-build - "release" and tc branch, as we want to use our fast profiled code +google-profiler - modified for use with gperf