From 6a35c235bed3bc48a8bab3cb52919ac3235c33d3 Mon Sep 17 00:00:00 2001 From: Stefan Ritt Date: Tue, 13 Jan 2015 09:14:29 +0100 Subject: [PATCH] Fixed more compiler warnings --- src/elconv.c | 10 +++------- src/elogd.c | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/elconv.c b/src/elconv.c index 7a97d939..4e3a3e84 100644 --- a/src/elconv.c +++ b/src/elconv.c @@ -159,10 +159,9 @@ void el_decode(char *message, char *key, char *result) int fnmatch1(const char *pattern, const char *string) { - const char *stringstart; char c, test; - for (stringstart = string;;) + for (;;) switch (c = *pattern++) { case EOS: return (*string == EOS ? 0 : 1); @@ -276,7 +275,7 @@ INT ss_file_find(char *path, char *pattern, char **plist) INT el_search_message(char *tag, int *fh, BOOL walk, BOOL first) { - int lfh, i, n, d, min, max, size, offset, direction, last, status, did_walk; + int lfh, i, n, d, min, max, size, offset, direction, status, did_walk; struct tm *tms, ltms; time_t lt, ltime, lact; char str[256], file_name[256], dir[256]; @@ -485,8 +484,6 @@ INT el_search_message(char *tag, int *fh, BOOL walk, BOOL first) /* seek next message */ /* read current message size */ - last = TELL(lfh); - i = read(lfh, str, 15); if (i <= 0) { close(lfh); @@ -850,7 +847,7 @@ INT el_get_v1(char *tag, char *message, int *bufsize) \********************************************************************/ { - int i, size, fh, offset, search_status; + int i, size, fh, search_status; char str[256]; if (tag[0]) { @@ -866,7 +863,6 @@ INT el_get_v1(char *tag, char *message, int *bufsize) } /* extract message size */ - offset = TELL(fh); i = read(fh, str, 16); if (i <= 0) { close(fh); diff --git a/src/elogd.c b/src/elogd.c index 2c589718..ced5f9a4 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -5163,7 +5163,7 @@ int el_delete_message(LOGBOOK * lbs, int message_id, BOOL delete_attachments, \********************************************************************/ { - int i, index, n, size, fh, tail_size, old_offset; + int i, index, size, fh, tail_size, old_offset; char str[MAX_PATH_LENGTH], file_name[MAX_PATH_LENGTH], reply_to[MAX_REPLY_TO * 10], in_reply_to[256]; char *buffer, *p; char *message, attachment_all[64 * MAX_ATTACHMENTS]; @@ -5268,12 +5268,12 @@ int el_delete_message(LOGBOOK * lbs, int message_id, BOOL delete_attachments, buffer = xmalloc(tail_size); lseek(fh, lbs->el_index[index].offset + size, SEEK_SET); - n = my_read(fh, buffer, tail_size); + my_read(fh, buffer, tail_size); } lseek(fh, lbs->el_index[index].offset, SEEK_SET); if (tail_size > 0) { - n = write(fh, buffer, tail_size); + write(fh, buffer, tail_size); xfree(buffer); }