Skip to content

Commit

Permalink
Merge pull request #450 from kennethshackleton/snprintf
Browse files Browse the repository at this point in the history
Use snprintf instead.
  • Loading branch information
kennethshackleton authored May 14, 2023
2 parents 0f07ca7 + baab3f4 commit ad5816d
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 ad5816d

Please sign in to comment.