strcpy() causing buggy behavior