Add ceiling on num_threads
parent
b2617eaaae
commit
52bb13efd6
2
main.c
2
main.c
|
@ -85,7 +85,9 @@ int main(int argc, char *argv[]) {
|
|||
if (errno == ERANGE || (num_threads == 0 && errno == EINVAL)) {
|
||||
printf("Invalid number of threads.\n");
|
||||
}
|
||||
num_threads = num_threads > MAXTHREAD ? MAXTHREAD : num_threads;
|
||||
|
||||
// TODO: Remove this. It's for debugging.
|
||||
int num_inputs = get_input(num_threads, &inputs);
|
||||
for (int i = 0; i < num_inputs; i++) {
|
||||
printf("#%d recipient=%d value=%d\n", i, inputs[i].recipient, inputs[i].value);
|
||||
|
|
Loading…
Reference in New Issue