change sprintf to snprintf for safety
convert sprintf to snprintf for safety
more sprintf to snprintf