fix bug.
Showing
2 changed files
with
8 additions
and
6 deletions
... | @@ -25,7 +25,7 @@ | ... | @@ -25,7 +25,7 @@ |
25 | int | 25 | int |
26 | mbox_set_progress_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) | 26 | mbox_set_progress_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) |
27 | { | 27 | { |
28 | if (mbox) | 28 | if (mbox == NULL) |
29 | return MU_ERROR_INVALID_PARAMETER; | 29 | return MU_ERROR_INVALID_PARAMETER; |
30 | mbox->progress.cb = cb; | 30 | mbox->progress.cb = cb; |
31 | mbox->progress.arg = arg; | 31 | mbox->progress.arg = arg; |
... | @@ -35,7 +35,7 @@ mbox_set_progress_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) | ... | @@ -35,7 +35,7 @@ mbox_set_progress_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) |
35 | int | 35 | int |
36 | mbox_set_newmsg_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) | 36 | mbox_set_newmsg_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) |
37 | { | 37 | { |
38 | if (mbox) | 38 | if (mbox == NULL) |
39 | return MU_ERROR_INVALID_PARAMETER; | 39 | return MU_ERROR_INVALID_PARAMETER; |
40 | mbox->newmsg.cb = cb; | 40 | mbox->newmsg.cb = cb; |
41 | mbox->newmsg.arg = arg; | 41 | mbox->newmsg.arg = arg; |
... | @@ -45,7 +45,7 @@ mbox_set_newmsg_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) | ... | @@ -45,7 +45,7 @@ mbox_set_newmsg_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) |
45 | int | 45 | int |
46 | mbox_set_error_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) | 46 | mbox_set_error_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) |
47 | { | 47 | { |
48 | if (mbox) | 48 | if (mbox == NULL) |
49 | return MU_ERROR_INVALID_PARAMETER; | 49 | return MU_ERROR_INVALID_PARAMETER; |
50 | mbox->error.cb = cb; | 50 | mbox->error.cb = cb; |
51 | mbox->error.arg = arg; | 51 | mbox->error.arg = arg; |
... | @@ -55,7 +55,7 @@ mbox_set_error_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) | ... | @@ -55,7 +55,7 @@ mbox_set_error_cb (mbox_t mbox, int (*cb) __P ((int, void *)), void *arg) |
55 | int | 55 | int |
56 | mbox_newmsg_cb (mbox_t mbox, int info) | 56 | mbox_newmsg_cb (mbox_t mbox, int info) |
57 | { | 57 | { |
58 | if (mbox) | 58 | if (mbox == NULL) |
59 | return MU_ERROR_INVALID_PARAMETER; | 59 | return MU_ERROR_INVALID_PARAMETER; |
60 | if (mbox->newmsg.cb) | 60 | if (mbox->newmsg.cb) |
61 | return mbox->newmsg.cb (info, mbox->newmsg.arg); | 61 | return mbox->newmsg.cb (info, mbox->newmsg.arg); |
... | @@ -65,7 +65,7 @@ mbox_newmsg_cb (mbox_t mbox, int info) | ... | @@ -65,7 +65,7 @@ mbox_newmsg_cb (mbox_t mbox, int info) |
65 | int | 65 | int |
66 | mbox_progress_cb (mbox_t mbox, int info) | 66 | mbox_progress_cb (mbox_t mbox, int info) |
67 | { | 67 | { |
68 | if (mbox) | 68 | if (mbox == NULL) |
69 | return MU_ERROR_INVALID_PARAMETER; | 69 | return MU_ERROR_INVALID_PARAMETER; |
70 | if (mbox->progress.cb) | 70 | if (mbox->progress.cb) |
71 | return mbox->progress.cb (info, mbox->progress.arg); | 71 | return mbox->progress.cb (info, mbox->progress.arg); |
... | @@ -75,7 +75,7 @@ mbox_progress_cb (mbox_t mbox, int info) | ... | @@ -75,7 +75,7 @@ mbox_progress_cb (mbox_t mbox, int info) |
75 | int | 75 | int |
76 | mbox_error_cb (mbox_t mbox, int info) | 76 | mbox_error_cb (mbox_t mbox, int info) |
77 | { | 77 | { |
78 | if (mbox) | 78 | if (mbox == NULL) |
79 | return MU_ERROR_INVALID_PARAMETER; | 79 | return MU_ERROR_INVALID_PARAMETER; |
80 | if (mbox->error.cb) | 80 | if (mbox->error.cb) |
81 | return mbox->error.cb (info, mbox->error.arg); | 81 | return mbox->error.cb (info, mbox->error.arg); | ... | ... |
... | @@ -176,6 +176,8 @@ mbox_scan0 (mbox_t mbox, unsigned int msgno, unsigned int *pcount, | ... | @@ -176,6 +176,8 @@ mbox_scan0 (mbox_t mbox, unsigned int msgno, unsigned int *pcount, |
176 | else | 176 | else |
177 | status = MU_ERROR_IO; | 177 | status = MU_ERROR_IO; |
178 | } | 178 | } |
179 | else | ||
180 | status = MU_ERROR_IO; | ||
179 | 181 | ||
180 | /* Move along, move along nothing to see. */ | 182 | /* Move along, move along nothing to see. */ |
181 | if (!mbox_has_newmail (mbox) && mbox->size == file_size) | 183 | if (!mbox_has_newmail (mbox) && mbox->size == file_size) | ... | ... |
-
Please register or sign in to post a comment