Open dcooley opened 1 year ago
linked issue - https://github.com/uber/h3/issues/774
I think our best option is to
h3Index.c
to fail
//sprintf(str, "%" PRIx64, h);
//return E_SUCCESS;
return E_FAILED;
h3ToString
from init.c
h3r
SEXP h3ToSexpString(H3Index h3) {
char str[17];
//h3ToString(h3, str, sizeof(str));
int res = snprintf(str, sizeof(str), "%" PRIx64, h3);
return Rf_mkChar(str);
}
H3Index.c
usessprintf
, but this won't pass R Checks (as of R 4.3)Reference - https://www.tidyverse.org/blog/2023/03/cran-checks-compiled-code/#warning-regarding-the-use-of-codesprintfcode-in-cc
The solution is to use
snprintf()
But this means we need to update the
H3
source code directly.