sprintf deprecated on macos

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry
2022-11-04 19:33:25 -07:00
parent c5e86ae0ae
commit 8200c6d920
2 changed files with 6 additions and 3 deletions

View File

@@ -729,8 +729,9 @@ SdfWriter::sdfPathName(const Pin *pin)
else {
char *inst_path = sdfPathName(inst);
const char *port_name = sdfPortName(pin);
char *sdf_name = makeTmpString(strlen(inst_path)+1+strlen(port_name)+1);
sprintf(sdf_name, "%s%c%s", inst_path, sdf_divider_, port_name);
size_t length = strlen(inst_path) + 1 + strlen(port_name) + 1;
char *sdf_name = makeTmpString(length);
snprintf(sdf_name, length, "%s%c%s", inst_path, sdf_divider_, port_name);
return sdf_name;
}
}