mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
fix too-small buffer. Seems I've done this before.
This commit is contained in:
parent
c6e994abef
commit
ba5ff6cb5d
1 changed files with 3 additions and 2 deletions
|
@ -241,9 +241,9 @@ do_deletes( int sockfd, const char** connNames, int nConnNames )
|
||||||
int ii;
|
int ii;
|
||||||
|
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
int nused = 0;
|
size_t nused = 0;
|
||||||
for ( ii = 0; ii < nConnNames; ++ii ) {
|
for ( ii = 0; ii < nConnNames; ++ii ) {
|
||||||
char tmp[32];
|
char tmp[128];
|
||||||
strcpy( tmp, connNames[ii] );
|
strcpy( tmp, connNames[ii] );
|
||||||
char* seedp = strrchr( tmp, '/' );
|
char* seedp = strrchr( tmp, '/' );
|
||||||
assert( !!seedp );
|
assert( !!seedp );
|
||||||
|
@ -256,6 +256,7 @@ do_deletes( int sockfd, const char** connNames, int nConnNames )
|
||||||
nused += sprintf( &buf[nused], "%s", tmp );
|
nused += sprintf( &buf[nused], "%s", tmp );
|
||||||
buf[nused++] = '\n';
|
buf[nused++] = '\n';
|
||||||
}
|
}
|
||||||
|
assert( nused < sizeof(buf) );
|
||||||
|
|
||||||
unsigned char hdr[] = { 0, PRX_DEVICE_GONE };
|
unsigned char hdr[] = { 0, PRX_DEVICE_GONE };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue