How do you know 12 is enough? I think you are supposed to use L_tmpnam here.