#endif
*r++ = (char)k;
else {
- /* The return value of sprintf() is unportable.
- * In modern systems it returns (int) the number of characters,
- * but in older systems it might return (char*) the original
- * buffer, or it might even be (void). The easiest portable
- * thing to do is probably use sprintf() in void context and
- * then strlen(buffer) for the length. The more proper way
- * would of course be to figure out the prototype of sprintf.
- * --jhi */
- sprintf(r, "\\x{%"UVxf"}", k);
- r += strlen(r);
+ r = r + my_sprintf(r, "\\x{%"UVxf"}", k);
}
}
*r++ = '"';
ival = SvRV(val);
realtype = SvTYPE(ival);
- (void) my_snprintf(id, sizeof(id), "0x%"UVxf, PTR2UV(ival));
- idlen = strlen(id);
+ idlen = my_snprintf(id, sizeof(id), "0x%"UVxf, PTR2UV(ival));
if (SvOBJECT(ival))
realpack = HvNAME_get(SvSTASH(ival));
else
ilen = inamelen;
sv_setiv(ixsv, ix);
- (void) sprintf(iname+ilen, "%"IVdf, (IV)ix);
- ilen = strlen(iname);
+ ilen = ilen + my_sprintf(iname+ilen, "%"IVdf, (IV)ix);
iname[ilen++] = ']'; iname[ilen] = '\0';
if (indent >= 3) {
sv_catsv(retval, totpad);
STRLEN i;
if (namelen) {
- (void) my_snprintf(id, sizeof(id), "0x%"UVxf, PTR2UV(val));
- if ((svp = hv_fetch(seenhv, id, (idlen = strlen(id)), FALSE)) &&
+ idlen = my_snprintf(id, sizeof(id), "0x%"UVxf, PTR2UV(val));
+ if ((svp = hv_fetch(seenhv, id, idlen, FALSE)) &&
(sv = *svp) && SvROK(sv) &&
(seenentry = (AV*)SvRV(sv)))
{
if (DD_is_integer(val)) {
STRLEN len;
if (SvIsUV(val))
- (void) my_snprintf(tmpbuf, sizeof(tmpbuf), "%"UVuf, SvUV(val));
+ len = my_snprintf(tmpbuf, sizeof(tmpbuf), "%"UVuf, SvUV(val));
else
- (void) my_snprintf(tmpbuf, sizeof(tmpbuf), "%"IVdf, SvIV(val));
- len = strlen(tmpbuf);
+ len = my_snprintf(tmpbuf, sizeof(tmpbuf), "%"IVdf, SvIV(val));
if (SvPOK(val)) {
/* Need to check to see if this is a string such as " 0".
I'm assuming from sprintf isn't going to clash with utf8.
STRLEN nchars;
sv_setpvn(name, "$", 1);
sv_catsv(name, varname);
- (void) my_snprintf(tmpbuf, sizeof(tmpbuf), "%"IVdf, (IV)(i+1));
- nchars = strlen(tmpbuf);
+ nchars = my_snprintf(tmpbuf, sizeof(tmpbuf), "%"IVdf, (IV)(i+1));
sv_catpvn(name, tmpbuf, nchars);
}