Skip to content

Commit f4a0714

Browse files
committed
Revert "Change xrt_xclbin.cpp"
This reverts commit f25f0d6.
1 parent 03fcfc6 commit f4a0714

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

src/runtime_src/core/common/api/xrt_xclbin.cpp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,15 +1748,10 @@ xrtXclbinGetXSAName(xrtXclbinHandle handle, char* name, int size, int* ret_size)
17481748
const std::string& xsaname = xclbin->get_xsa_name();
17491749
// populate ret_size if memory is allocated
17501750
if (ret_size)
1751-
*ret_size = xsaname.size() + 1;
1751+
*ret_size = xsaname.size();
17521752
// populate name if memory is allocated
1753-
if (!name || size == 0)
1754-
return 0;
1755-
1756-
auto cp_len = std::min(size - 1, static_cast<int>(xsaname.size()));
1757-
std::memcpy(name, xsaname.c_str(), cp_len);
1758-
name[cp_len] = 0;
1759-
1753+
if (name)
1754+
std::strncpy(name, xsaname.c_str(), size);
17601755
return 0;
17611756
});
17621757
}

0 commit comments

Comments
 (0)