Skip to content

Commit

Permalink
Use snprintf instead.
Browse files Browse the repository at this point in the history
Signed-off-by: Kenneth J. Shackleton <kshackleton1@bloomberg.net>
  • Loading branch information
kennethshackleton committed May 14, 2023
1 parent 0f07ca7 commit baab3f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion selekt-sqlite3/sqlite3_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static jint rawKey(
int i;
char * const hex = sql + prefix.length();
for (i = 0; i < keyLength; ++i) {
std::sprintf(hex + (2 * i), "%02x", key[i]);
std::snprintf(hex + (2 * i), 3, "%02x", key[i]);
}
std::strcpy(sql + length - suffix.length(), suffix.c_str());
auto result = sqlite3_exec(reinterpret_cast<sqlite3*>(jdb), sql, nullptr, nullptr, nullptr);
Expand Down

0 comments on commit baab3f4

Please sign in to comment.