snprintf doesn't work as snprintf(buffer,10," %2s ",string). It does nothing. Also malloc reserves begining of .noinit section for heap storage whereas compiler doesn't know about it and variables declared to be in .noinit section are overitten!
-- Pozdrowienia Robert Seczkowski rs...@poczta.onet.pl //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\