/* Must be called with PerlIO_mutex locked. */
static void
S_more_refcounted_fds(pTHX_ const int new_fd) {
+ dVAR;
const int old_max = PL_perlio_fd_refcnt_size;
const int new_max = 16 + (new_fd & ~15);
int *new_array;
PL_perlio_fd_refcnt_size = new_max;
PL_perlio_fd_refcnt = new_array;
- PerlIO_debug("Zeroing %p, %d\n", new_array + old_max, new_max - old_max);
+ PerlIO_debug("Zeroing %p, %d\n",
+ (void*)(new_array + old_max),
+ new_max - old_max);
Zero(new_array + old_max, new_max - old_max, int);
}
{
dVAR;
#ifdef USE_VSNPRINTF
- const int val = vsnprintf(s, n, fmt, ap);
+ const int val = vsnprintf(s, n > 0 ? n : 0, fmt, ap);
#else
const int val = vsprintf(s, fmt, ap);
#endif /* #ifdef USE_VSNPRINTF */