Numerous minor fixes to nap plugin

This commit is contained in:
Kevin Easton
2017-11-25 00:53:43 +11:00
parent 862137d975
commit 21ed1a01a3
3 changed files with 34 additions and 36 deletions

View File

@@ -482,12 +482,11 @@ unsigned long nbytes = 0;
if (gf && gf->count)
{
int flags = O_WRONLY;
memset(&indata, 0, 200);
if ((rc = read(snum, &indata, gf->count)) != gf->count)
return;
if (!isdigit(*indata) || !*(indata+1) || !isdigit(*(indata+1)))
{
rc += read(snum, &indata[gf->count], sizeof(indata)-1);
rc += read(snum, &indata[gf->count], sizeof indata - gf->count);
indata[rc] = 0;
nap_say("Request from %s is %s", gf->nick, indata);
gf = find_in_getfile(&getfile_struct, 1, gf->nick, gf->checksum, gf->filename, -1, NAP_DOWNLOAD);
@@ -525,7 +524,8 @@ unsigned long nbytes = 0;
send_ncommand(CMDS_UPDATE_GET, NULL);
return;
}
if ((rc = ioctl(snum, FIONREAD, &nbytes) != -1))
rc = ioctl(snum, FIONREAD, &nbytes);
if (rc != -1)
{
if (nbytes)
{