mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-22 15:48:09 -05:00
Merge pull request #1 from foxtacles/perfect-setdevicename
lego1: perfect SetDeviceName
This commit is contained in:
commit
753ed04611
1 changed files with 8 additions and 7 deletions
|
@ -30,22 +30,23 @@ MxVideoParam &MxVideoParam::operator=(const MxVideoParam &other)
|
|||
return *this;
|
||||
}
|
||||
|
||||
// TODO: this doesn't match exactly, something weird with the conditional on id
|
||||
void MxVideoParam::SetDeviceName(char *id)
|
||||
{
|
||||
if (this->m_deviceId != 0)
|
||||
free(this->m_deviceId);
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
this->m_deviceId = 0;
|
||||
}
|
||||
else
|
||||
if (id != 0)
|
||||
{
|
||||
this->m_deviceId = (char *)malloc(strlen(id) + 1);
|
||||
|
||||
if (this->m_deviceId != 0) {
|
||||
strcpy(this->m_deviceId, id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this->m_deviceId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
MxVideoParam::~MxVideoParam()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue