mirror of
https://github.com/monero-project/monero.git
synced 2026-06-12 19:11:36 -07:00
src: replace deprecated sprintf calls
This commit is contained in:
@@ -272,7 +272,7 @@ plot 'stats.csv' index "DATA" using (timecolumn(1,"%Y-%m-%d")):4 with lines, ''
|
||||
char buf[8];
|
||||
unsigned int i;
|
||||
for (i=0; i<24; i++) {
|
||||
sprintf(buf, "\t%02u:00", i);
|
||||
snprintf(buf, sizeof(buf), "\t%02u:00", i);
|
||||
std::cout << buf;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ namespace hw {
|
||||
void buffer_to_str(char *to_buff, size_t to_len, const char *buff, size_t len) {
|
||||
CHECK_AND_ASSERT_THROW_MES(to_len > (len*2), "destination buffer too short. At least" << (len*2+1) << " bytes required");
|
||||
for (size_t i=0; i<len; i++) {
|
||||
sprintf(to_buff+2*i, "%.02x", (unsigned char)buff[i]);
|
||||
snprintf(to_buff + 2 * i, to_len - 2 * i, "%.02x", (unsigned char)buff[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user