Remove usage of strcat, since OpenBSD does not like that.

This commit is contained in:
Jan Vidar Krey 2014-05-13 20:13:11 +02:00
parent 12ce522a6d
commit 24b98358d3
1 changed files with 5 additions and 3 deletions

View File

@ -64,6 +64,7 @@ static enum command_parse_status command_extract_arguments(struct hub_info* hub,
char* token = NULL;
char* tmp = NULL;
size_t size = 0;
size_t offset = 0;
struct hub_command_arg_data* data = NULL;
enum command_parse_status status = cmd_status_ok;
@ -82,9 +83,10 @@ static enum command_parse_status command_extract_arguments(struct hub_info* hub,
while ((tmp = list_get_first(tokens)))
{
if (*token)
strcat(token, " ");
strcat(token, tmp);
if (offset > 0)
token[offset++] = ' ';
memcpy(token + offset, tmp, strlen(tmp));
offset += strlen(tmp);
list_remove(tokens, tmp);
hub_free(tmp);
}