This is a part of my code (where max is a float):
printf("noise level found: %f\n", max);
//Put into "String"
char var[21];
sprintf(var, "%f", max);
setenv("music_sync_soundcard_noise_level",var,1);
printf("noise level written\n");
Which produces the output:
noise level found: 2410965368832.000000
Segmentation fault
While some lines earlier I have almost the same:
printf("test finished, offset is %f\n", *offset);
//Put into "String"
char var[20];
sprintf(var, "%f", *offset);
setenv("music_sync_soundcard_offset",var,1);
Which works without a problem.
//EDIT: Changed Arraysize, sadly didn't fix problem