aboutsummaryrefslogtreecommitdiffstats
path: root/help.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-09-05 12:31:22 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-09-05 12:31:22 +0100
commitfef78131a46462ee1d1457aa690c52a52b23151a (patch)
treec4ecee50eb32da7aee9587b7a107eb2ab348e48a /help.c
parent41e0c00fd22d1cdace2040be5912d64f51f12ab8 (diff)
Fix compiler warnings. Also fixing irc_send_motd(), which so far got away
with a horrible practice of reading the MOTD file one by one.
Diffstat (limited to 'help.c')
-rw-r--r--help.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/help.c b/help.c
index c43d0459..14156eaf 100644
--- a/help.c
+++ b/help.c
@@ -156,8 +156,9 @@ char *help_get( help_t **help, char *title )
return NULL;
}
- lseek( h->fd, h->offset.file_offset, SEEK_SET );
- read( h->fd, s, h->length );
+ if( lseek( h->fd, h->offset.file_offset, SEEK_SET ) == -1 ||
+ read( h->fd, s, h->length ) != h->length )
+ return NULL;
}
else
{