Find end of string when it has many trailing nulls

I finally was able to find a solution...using strlen(char buffer) seems to work well.