mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
fix parsing of relay ids by replacing separating \n with \0.
This commit is contained in:
parent
111c59dd30
commit
1720fbbd50
1 changed files with 19 additions and 17 deletions
|
@ -773,25 +773,27 @@ handle_proxy_tproc( void* closure )
|
||||||
int ii;
|
int ii;
|
||||||
for ( ii = 0; ii < nameCount; ++ii ) {
|
for ( ii = 0; ii < nameCount; ++ii ) {
|
||||||
unsigned short seed;
|
unsigned short seed;
|
||||||
if ( getNetShort( &bufp, end, &seed ) ) {
|
if ( !getNetShort( &bufp, end, &seed ) ) {
|
||||||
const unsigned char* crptr =
|
break;
|
||||||
|
}
|
||||||
|
unsigned char* crptr =
|
||||||
(unsigned char*)strchr( (char*)bufp, '\n' );
|
(unsigned char*)strchr( (char*)bufp, '\n' );
|
||||||
if ( NULL != crptr && crptr < end ) {
|
if ( NULL == crptr || crptr >= end ) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
*crptr = '\0';
|
||||||
|
|
||||||
HostID hid;
|
HostID hid;
|
||||||
char connName[MAX_CONNNAME_LEN+1];
|
char connName[MAX_CONNNAME_LEN+1];
|
||||||
if ( parseRelayID( (char*)bufp, connName,
|
if ( !parseRelayID( (const char*)bufp, connName,
|
||||||
&hid ) ) {
|
&hid ) ) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
SafeCref scr( connName );
|
SafeCref scr( connName );
|
||||||
scr.DeviceGone( hid, seed );
|
scr.DeviceGone( hid, seed );
|
||||||
}
|
|
||||||
/* skip "\n" */
|
/* skip "\n" */
|
||||||
bufp = (unsigned char*)crptr + 1;
|
bufp = crptr + 1;
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue