mirror of
https://github.com/EnergyMech/energymech.git
synced 2025-12-17 15:36:50 +00:00
Investigated and fixed up more compiler warnings. Now builds clean on gcc7.3
This commit is contained in:
parent
cc752e9ccd
commit
2f910d1725
@ -476,7 +476,8 @@ void channel_massmode(const Chan *chan, char *pattern, int filtmode, char mode,
|
||||
{
|
||||
if ((Strlen2(deopstring,burst)) >= MSGLEN-2) // burst is never NULL
|
||||
{
|
||||
write(current->sock,burst,strlen(burst));
|
||||
if (write(current->sock,burst,strlen(burst)) == -1)
|
||||
return;
|
||||
#ifdef DEBUG
|
||||
debug("(channel_massmode)\n%s\n",burst);
|
||||
#endif /* DEBUG */
|
||||
@ -489,7 +490,8 @@ void channel_massmode(const Chan *chan, char *pattern, int filtmode, char mode,
|
||||
|
||||
if (strlen(burst))
|
||||
{
|
||||
write(current->sock,burst,strlen(burst));
|
||||
if (write(current->sock,burst,strlen(burst)) == -1)
|
||||
return;
|
||||
#ifdef DEBUG
|
||||
debug("(...)\n%s\n",burst);
|
||||
#endif /* DEBUG */
|
||||
|
||||
10
src/ctcp.c
10
src/ctcp.c
@ -152,7 +152,7 @@ void dcc_pushfile(Client *client, off_t where)
|
||||
sz = read(client->fileno,tempdata,sz);
|
||||
if (sz < 1)
|
||||
return;
|
||||
write(client->sock,tempdata,sz);
|
||||
sz = write(client->sock,tempdata,sz);
|
||||
}
|
||||
|
||||
int dcc_freeslots(int uaccess)
|
||||
@ -235,7 +235,8 @@ void parse_dcc(Client *client)
|
||||
{
|
||||
s = read(client->sock,bigtemp,4096);
|
||||
if (s > 0)
|
||||
write(client->fileno,bigtemp,s);
|
||||
if (write(client->fileno,bigtemp,s) == -1)
|
||||
return;
|
||||
}
|
||||
while(s > 0);
|
||||
|
||||
@ -244,7 +245,10 @@ void parse_dcc(Client *client)
|
||||
|
||||
where = oc = lseek(client->fileno,0,SEEK_CUR);
|
||||
where = htonl(where);
|
||||
write(client->sock,&where,4);
|
||||
|
||||
if (write(client->sock,&where,4) == -1)
|
||||
return;
|
||||
|
||||
client->lasttime = now;
|
||||
|
||||
if (oc == client->fileend)
|
||||
|
||||
@ -299,7 +299,9 @@ void send_redirect(char *message)
|
||||
if ((fd = open(redirect.to,O_WRONLY|O_CREAT|O_APPEND,NEWFILEMODE)) < 0)
|
||||
return;
|
||||
fmt = stringcat(message,"\n");
|
||||
write(fd,message,(fmt-message));
|
||||
if (write(fd,message,(fmt-message)) == -1)
|
||||
return;
|
||||
|
||||
close(fd);
|
||||
return;
|
||||
#ifdef BOTNET
|
||||
@ -936,7 +938,7 @@ void do_info(COMMAND_ARGS)
|
||||
{
|
||||
avg = (stats->userpeak + stats->userlow) / 2;
|
||||
}
|
||||
sprintf(p,"%-7lu %-4i %i",avg,stats->userpeak,stats->userlow);
|
||||
sprintf(p,"%-7u %-4i %i",avg,stats->userpeak,stats->userlow);
|
||||
to_user(from,FMT_PLAIN,text);
|
||||
sprintf(text,"Messages: %i Notices: %i Joins: %i Parts: %i Kicks: %i Quits: %i",
|
||||
stats->privmsg,stats->notice,stats->joins,stats->parts,stats->kicks,stats->quits);
|
||||
|
||||
@ -365,10 +365,13 @@ char *random_question(char *triv_rand)
|
||||
n--;
|
||||
|
||||
lseek(ifd,(n * sizeof(entry)),SEEK_SET);
|
||||
read(ifd,&entry,sizeof(entry));
|
||||
if (read(ifd,&entry,sizeof(entry)) == -1)
|
||||
return(NULL);
|
||||
|
||||
lseek(fd,entry.off,SEEK_SET);
|
||||
read(fd,triv_rand,entry.sz);
|
||||
if (read(fd,triv_rand,entry.sz) == -1)
|
||||
return(NULL);
|
||||
|
||||
triv_rand[entry.sz] = 0;
|
||||
|
||||
close(fd);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user