memcpy(global_proxy_host, optarg, (size_t)(position - optarg));
global_proxy_host[position - optarg] = '\0';
- global_proxy_port = malloc(strlen(position + 1) + 1);
+ global_proxy_host = strdup(position + 1);
if (global_proxy_port == NULL) {
- perror("malloc()");
+ perror("strdup()");
exit(EXIT_FAILURE);
}
- strcpy(global_proxy_port, position + 1);
break;
}