Thanks for the replies. I've done a little bit of researching myself after SirDice's comment. Apparently, one should never use sprintf(). Nasty buffer overrun waiting to happen - snprintf() would be the secure way of doing it. Appreciate the help guys.