Rewrote copying of contact list for /who

This commit is contained in:
James Booth
2012-03-20 00:05:33 +00:00
parent 9a3a0840e3
commit dab37236a2
7 changed files with 231 additions and 151 deletions

View File

@@ -43,7 +43,7 @@ void history_init(void)
void history_append(const char * const inp)
{
if (_size < MAX_HISTORY) {
_history[_size] = (char*) malloc(strlen(inp) * sizeof(char));
_history[_size] = (char*) malloc((strlen(inp) + 1) * sizeof(char));
strcpy(_history[_size], inp);
_pos = _size;
_size++;