Skip to content

Commit

Permalink
[core] #2845 removed previous specific cases handling optlen == -1
Browse files Browse the repository at this point in the history
  • Loading branch information
yomnes0 committed Jan 9, 2024
1 parent e3ac839 commit ceedcb0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions srtcore/socketconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,8 @@ struct CSrtConfigSetter<SRTO_BINDTODEVICE>
using namespace std;

string val;
if (optlen == -1)
val = (const char *)optval;
else
val.assign((const char *)optval, optlen);

val.assign((const char *)optval, optlen);
if (val.size() >= IFNAMSIZ)
{
LOGC(kmlog.Error, log << "SRTO_BINDTODEVICE: device name too long (max: IFNAMSIZ=" << IFNAMSIZ << ")");
Expand Down Expand Up @@ -597,10 +595,7 @@ struct CSrtConfigSetter<SRTO_CONGESTION>
static void set(CSrtConfig& co, const void* optval, int optlen)
{
std::string val;
if (optlen == -1)
val = (const char*)optval;
else
val.assign((const char*)optval, optlen);
val.assign((const char*)optval, optlen);

// Translate alias
if (val == "vod")
Expand Down

0 comments on commit ceedcb0

Please sign in to comment.