libcs50
libcs50 copied to clipboard
ft: buffer resizing in get_string to prevent overflow
Changes
- Buffer now starts with 64 bytes capacity
- Capacity doubles each time expansion is needed
- Reduces number of reallocations from O(n) to O(log n) for n characters
- Maintains full backward compatibility