aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2024-05-06 16:30:11 -0600
committerJack Sangdahl <[email protected]>2024-05-06 16:30:11 -0600
commit7caf1387f967d58c0ba6d29b30a62fcd61b4caa0 (patch)
tree40a3eea9ff4d5b91efa2f8599b0aa832c857afb0
parent4bf6f6c396c2961dd7c7b435686c84aa5ad25591 (diff)
downloadcsci3753-7caf1387f967d58c0ba6d29b30a62fcd61b4caa0.tar.gz
csci3753-7caf1387f967d58c0ba6d29b30a62fcd61b4caa0.zip
pa6: fix segfault
-rw-r--r--pa6_threaded_resolver/multi-lookup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pa6_threaded_resolver/multi-lookup.c b/pa6_threaded_resolver/multi-lookup.c
index f10c947..2956b8f 100644
--- 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);
}