You used vasprintf but used asprintf paramaters. Which one do you want to use? i changed to asprintf now.