Skip to content

Commit 330c609

Browse files
committed
argument can be empty
1 parent e9c9e10 commit 330c609

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

DataFormats/Headers/include/Headers/DataHeader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ struct Descriptor {
259259
void runtimeInit(std::string_view string)
260260
{
261261
// empty strings and string longet than the descriptor size are not allowed
262-
if (string.empty() || (string[0] != 0 && string.size() > (int)N)) {
263-
throw std::invalid_argument("argument must not be empty or longer than the descriptor size");
262+
if (!string.empty() && (string.size() > (int)N)) {
263+
throw std::invalid_argument("argument must not be longer than the descriptor size");
264264
}
265265
// copy the content directly
266266
std::memcpy(str, string.data(), string.size());

0 commit comments

Comments
 (0)