Mi spieghi questa

buff = malloc(temp = malloc(strlen(...)+...);

?

E perchè tutti quei

\0

all'interno delle stringhe?