exit(0);
#endif
case 'U':
- chdir(CONFDIR);
+ if (chdir(CONFDIR) < 0)
+ {
+ fprintf(stderr, "Unable to change to '%s' directory\n", CONFDIR);
+ exit(1);
+ }
update_conf();
exit(0);
case 'R':
me.name, sptr->name);
return 0;
}
- for (; (*ctcp == ' '); ctcp++); /* skip leading spaces */
+ for (; *ctcp == ' '; ctcp++); /* skip leading spaces */
if (*ctcp == '"' && *(ctcp+1))
end = index(ctcp+1, '"');
/* First check if the line contains a terminating \n. If not, don't process it
* as it may have been a cut header.
*/
- for (p; *p; p++)
+ for (; *p; p++)
{
if (*p == '\n')
{
p = k;
- for (p; *p; p++)
+ for (; *p; p++)
{
if ((*p == '\n') || (*p == '\r'))
{
#ifndef _WIN32
strlcat(debugbuf, "\n", sizeof(debugbuf));
- write(debugfd, debugbuf, strlen(debugbuf));
+ if (write(debugfd, debugbuf, strlen(debugbuf)) < 0)
+ {
+ /* Yeah.. what can we do if output isn't working? Outputting an error makes no sense */
+ ;
+ }
#else
strlcat(debugbuf, "\r\n", sizeof(debugbuf));
OutputDebugString(debugbuf);
for (dconf = conf_deny_dcc; dconf; dconf = next)
{
next = dconf->next;
- if ((dconf->flag.type2 == CONF_BAN_TYPE_AKILL))
+ if (dconf->flag.type2 == CONF_BAN_TYPE_AKILL)
{
DelListItem(dconf, conf_deny_dcc);
if (dconf->filename)
}
if (logs->logfd != -1)
{
- write(logs->logfd, "Max file size reached, starting new log file\n", 45);
+ if (write(logs->logfd, "Max file size reached, starting new log file\n", 45) < 0)
+ {
+ /* We already handle the unable to write to log file case for normal data.
+ * I think we can get away with not handling this one.
+ */
+ ;
+ }
fd_close(logs->logfd);
}
/* this shouldn't happen, but lets not waste unnecessary syscalls... */
if (logs->logfd == -1)
continue;
- write(logs->logfd, timebuf, strlen(timebuf));
+ if (write(logs->logfd, timebuf, strlen(timebuf)) < 0)
+ {
+ /* Let's ignore any write errors for this one. Next write() will catch it... */
+ ;
+ }
n = write(logs->logfd, buf, strlen(buf));
if (n == strlen(buf))
{
}
}
}
-/*
- * list all server names in scache very verbose
- */
-
-void list_scache(aClient *sptr)
-{
- int hash_index;
- SCACHE *ptr;
-
- for (hash_index = 0; hash_index < SCACHE_HASH_SIZE; hash_index++)
- {
- ptr = scache_hash[hash_index];
- while (ptr)
- {
- if (ptr->name)
- sendto_one(sptr,
- ":%s NOTICE %s :server=%s hash=%i",
- me.name, sptr->name, ptr->name, hash_index);
- ptr = ptr->next;
- }
- }
-
-}