tidyverse / vroom

Fast reading of delimited files
https://vroom.r-lib.org
Other
621 stars 60 forks source link

Replace sprintf() with snprintf() #480

Closed jeroen closed 1 year ago

jeroen commented 1 year ago

In vroom_write.cc we know the size of the output buffer (defined in the line above) so we use that to limit the size.

The two cases in grisu3.c we don't know the size of the buffer, so we limit to the input size+1. (+1 for the null terminator).

jennybc commented 1 year ago

Thanks!

In terms of the vendored grisu code, it feels like I should be recording this patch in some appropriately visible way. Unlike readxl / libxls, this is not a case where we re-ingest the code often (or ever?), but it still seems like a good practice. For repeated vendoring, you usually have a script or some sort of playbook, where you can record the patching. Do you have any thoughts on keeping these sorts of patches highly visible?

jennybc commented 1 year ago

I'm going to merge this, so I can start revdep and other pre-release checks. But I think I probably will revisit this and try to make the file's provenance and evolution more clear. Thanks again for the patches.