telehash / telehash-c

telehash tools library in c
MIT License
122 stars 31 forks source link

qsort_r funny in lib/packet.c #6

Closed alanz closed 10 years ago

alanz commented 10 years ago

On linux the last two parameters of qsort_r seem to be swapped.

I need to replace

qsort_r(p->js,keys,sizeof(unsigned short)*4,p->json,pkeycmp);

with

qsort_r(p->js,keys,sizeof(unsigned short)*4,pkeycmp,p->json);

otherwise it segfaults.

What is the best way of resolving this?