libcs50 icon indicating copy to clipboard operation
libcs50 copied to clipboard

ft: buffer resizing in get_string to prevent overflow

Open m9tzin opened this issue 1 year ago • 0 comments

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

m9tzin avatar Nov 19 '25 01:11 m9tzin