use strncp - you know the lengh of data in buffer