Getting this error when performing make:
$ make
cc -O2 -g src/bittwist.c -o src/bittwist -I/usr/local/include -L/usr/local/lib -lpcap
cc -O2 -g src/bittwiste.c -o src/bittwiste -I/usr/local/include -L/usr/local/lib -lpcap
src/bittwiste.c: In function ‘main’:
src/bittwiste.c:99:21: warning: format ‘%x’ expects argument of type ‘unsigned int *’, but argument 3 has type ‘u_char *’ [-Wformat=]
sscanf(optarg, "%02x", &payload_opt[i]);
^
Here is the code:
payload_len_opt = (u_short)c / 2; / possible resizing in editing functions /
payload_opt = (u_char *)malloc(sizeof(u_char) *payload_len_opt);
if (payload_opt == NULL)
error("malloc(): cannot allocate memory for payload_opt"); / make a byte of data from every 2 characters of optarg /
for (i = 0; i < payload_len_opt; i++) {
/ ugly - let me know if there is a better way to achieve this /
sscanf(optarg, "%02x", &payload_opt[i]);
I'm using Ubuntu 14.04.2 LTS