And... as murphy's law would have it, I figure out my problem immediately after asking for help. Forgot that with strcpy I needed to allocate an extra space for the \0.