commit 7caf1387f967d58c0ba6d29b30a62fcd61b4caa0
parent 4bf6f6c396c2961dd7c7b435686c84aa5ad25591
Author: Jack Sangdahl <0x6A73@pm.me>
Date: Mon, 6 May 2024 16:30:11 -0600
pa6: fix segfault
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pa6_threaded_resolver/multi-lookup.c b/pa6_threaded_resolver/multi-lookup.c
@@ -116,7 +116,7 @@ void *request(void *data) {
pthread_mutex_lock(req_data->req_log_lock);
fprintf(req_data->req_log, "%s", line);
pthread_mutex_unlock(req_data->req_log_lock);
- queue_push(req_data->buffer, strndup(strtok(line, "\n"), strlen(line)));
+ queue_push(req_data->buffer, strdup(line));
pthread_mutex_unlock(req_data->m);
pthread_cond_signal(req_data->c_res);
}