Congrats on the almost-3-years! Been there and it’s good to keep celebrating the achievements imho :) I have a mini celebration each year to reflect on all that’s happened since I stopped doing drugs and it’s only for the better, even though the craving never fully goes away for me.
Without knowing the details of C, I’ve seen this in other languages and it’s usually something with missing a flush or a buffered output mode or something like that.