Clean strlcpy arguments

This commit is contained in:
Léa Saviot
2018-10-15 15:56:12 +02:00
committed by EmilieNumworks
parent 06999e8e2e
commit 5d92f13c26
16 changed files with 69 additions and 84 deletions

View File

@@ -4,6 +4,8 @@
namespace Code {
static inline int min(int x, int y) { return (x<y ? x : y); }
ConsoleStore::ConsoleStore() :
m_history{0}
{
@@ -112,7 +114,7 @@ void ConsoleStore::push(const char marker, const char * text, size_t length) {
i = indexOfNullMarker();
}
m_history[i] = marker;
strlcpy(&m_history[i+1], text, textLength+1);
strlcpy(&m_history[i+1], text, min(k_historySize-(i+1),textLength+1));
m_history[i+1+textLength+1] = 0;
}