onetrueawk / awk

One true awk
Other
1.98k stars 159 forks source link

Prefer snprintf over sprintf #181

Closed RSilicon closed 1 year ago

RSilicon commented 1 year ago

sprintf is deprecated

Connor-GH commented 1 year ago

This might have been a decision made for speed. The argument could probably be that no integer could fit into i that is over or at 50 bytes in length, and so the sprintf should always succeed. With this project's scope targeting 64-bit computers, I do not see why any useless bounds checking would be made here, as the programmer can prove that bounds checking is not needed.