replace sizeofstr with strlen

We can use buildin C funtion.