daqana / tikzDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.
https://daqana.github.io/tikzDevice
132 stars 26 forks source link

New WARN on CRAN #218

Closed rstub closed 1 year ago

rstub commented 1 year ago

Please see the problems shown on https://cran.r-project.org/web/checks/check_results_tikzDevice.html.

Please correct before 2023-02-11 to safely retain your package on CRAN.

For further details see https://www.stats.ox.ac.uk/pub/bdr/sprintf.txt

I can reproduce this with rhub::check_with_rdevel(). Problem seems to be here: https://github.com/daqana/tikzDevice/blob/406f644c9df6f14abba99634d58d468cd7d64957/src/tikzDevice.c#L629

Since tikzInfo->pageNum is an integer, one can use floor(log10(tikzInfo->pageNum)) + 1 to compute its length as a string when replacing sprintf with snprintf.