First implementation was doing: - strdup (without checking result!) - strlen - terminate - realloc New one does: - malloc to shortest +1 - strncpy - terminate
1.4 KiB
1.4 KiB
First implementation was doing: - strdup (without checking result!) - strlen - terminate - realloc New one does: - malloc to shortest +1 - strncpy - terminate