giltene / wrk2

A constant throughput, correct latency recording variant of wrk
Apache License 2.0
4.27k stars 390 forks source link

getopt_long returns 255 #102

Open huangshiyou opened 3 years ago

huangshiyou commented 3 years ago

When I tried to run wrk2 on an arm machine, it gives me incorrect results when parsing command-line arguments. It turns out that https://github.com/giltene/wrk2/blob/44a94c17d8e6a0bac8559b53da76848e430cb7a7/src/wrk.c#L721 assigns the return value of which the type is int to c of which the type is char. -1 is converted to 255.

Change char to signed char solves the problem.