snprintf: good.
snprintf with a correct size: better!
(harmless in this case)
return 2;
}
if(chflgs & (ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB)) {
- (void) snprintf(tmphex, 11, "\\%02X", chtmp);
+ (void) snprintf(tmphex, sizeof tmphex, "\\%02X", chtmp);
if(!io_ch(arg, tmphex, 3)) return -1;
return 3;
}
return 2;
}
if(chflgs & (ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB)) {
- (void) snprintf(tmphex, 11, "\\%02X", chtmp);
+ (void) snprintf(tmphex, sizeof tmphex, "\\%02X", chtmp);
if(!io_ch(arg, tmphex, 3)) return -1;
return 3;
}