Skip to content

Commit

Permalink
doc: fix the order of arguments to calloc()
Browse files Browse the repository at this point in the history
PR-URL: libuv#2835
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
MasterDuke17 authored and JeffroMF committed May 16, 2022
1 parent c76f4ec commit e62ac76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/code/multi-echo-server/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ void setup_workers() {

child_worker_count = cpu_count;

workers = calloc(sizeof(struct child_worker), cpu_count);
workers = calloc(cpu_count, sizeof(struct child_worker));
while (cpu_count--) {
struct child_worker *worker = &workers[cpu_count];
uv_pipe_init(loop, &worker->pipe, 1);
Expand Down

0 comments on commit e62ac76

Please sign in to comment.