Remove usage of strcat, since OpenBSD does not like that.
This commit is contained in:
parent
12ce522a6d
commit
24b98358d3
@ -64,6 +64,7 @@ static enum command_parse_status command_extract_arguments(struct hub_info* hub,
|
|||||||
char* token = NULL;
|
char* token = NULL;
|
||||||
char* tmp = NULL;
|
char* tmp = NULL;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
|
size_t offset = 0;
|
||||||
struct hub_command_arg_data* data = NULL;
|
struct hub_command_arg_data* data = NULL;
|
||||||
enum command_parse_status status = cmd_status_ok;
|
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)))
|
while ((tmp = list_get_first(tokens)))
|
||||||
{
|
{
|
||||||
if (*token)
|
if (offset > 0)
|
||||||
strcat(token, " ");
|
token[offset++] = ' ';
|
||||||
strcat(token, tmp);
|
memcpy(token + offset, tmp, strlen(tmp));
|
||||||
|
offset += strlen(tmp);
|
||||||
list_remove(tokens, tmp);
|
list_remove(tokens, tmp);
|
||||||
hub_free(tmp);
|
hub_free(tmp);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user