Fixed more compiler warnings

This commit is contained in:
Stefan Ritt 2015-01-13 09:14:29 +01:00
parent ef2b80af41
commit 6a35c235be
2 changed files with 6 additions and 10 deletions

View File

@ -159,10 +159,9 @@ void el_decode(char *message, char *key, char *result)
int fnmatch1(const char *pattern, const char *string) int fnmatch1(const char *pattern, const char *string)
{ {
const char *stringstart;
char c, test; char c, test;
for (stringstart = string;;) for (;;)
switch (c = *pattern++) { switch (c = *pattern++) {
case EOS: case EOS:
return (*string == EOS ? 0 : 1); 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 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; struct tm *tms, ltms;
time_t lt, ltime, lact; time_t lt, ltime, lact;
char str[256], file_name[256], dir[256]; 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 */ /* seek next message */
/* read current message size */ /* read current message size */
last = TELL(lfh);
i = read(lfh, str, 15); i = read(lfh, str, 15);
if (i <= 0) { if (i <= 0) {
close(lfh); 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]; char str[256];
if (tag[0]) { if (tag[0]) {
@ -866,7 +863,6 @@ INT el_get_v1(char *tag, char *message, int *bufsize)
} }
/* extract message size */ /* extract message size */
offset = TELL(fh);
i = read(fh, str, 16); i = read(fh, str, 16);
if (i <= 0) { if (i <= 0) {
close(fh); close(fh);

View File

@ -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 str[MAX_PATH_LENGTH], file_name[MAX_PATH_LENGTH], reply_to[MAX_REPLY_TO * 10], in_reply_to[256];
char *buffer, *p; char *buffer, *p;
char *message, attachment_all[64 * MAX_ATTACHMENTS]; 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); buffer = xmalloc(tail_size);
lseek(fh, lbs->el_index[index].offset + size, SEEK_SET); 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); lseek(fh, lbs->el_index[index].offset, SEEK_SET);
if (tail_size > 0) { if (tail_size > 0) {
n = write(fh, buffer, tail_size); write(fh, buffer, tail_size);
xfree(buffer); xfree(buffer);
} }