bug fix(wrong use of strlen), update main.c