diff --git a/freshclam/mirman.c b/freshclam/mirman.c index 3885fea1b..3a9cb1d93 100644 --- a/freshclam/mirman.c +++ b/freshclam/mirman.c @@ -170,12 +170,15 @@ static int mirman_update_int(uint32_t *ip, int af, struct mirdat *mdat, uint8_t if(found) { mdat->mirtab[i].atime = 0; /* will be updated in mirman_write() */ if(succ || fail) { - mdat->mirtab[i].fail += fail; - if(mdat->mirtab[i].fail < 0) + if((int) mdat->mirtab[i].fail + fail < 0) mdat->mirtab[i].fail = 0; - mdat->mirtab[i].succ += succ; - if(mdat->mirtab[i].succ < 0) + else + mdat->mirtab[i].fail += fail; + + if((int) mdat->mirtab[i].succ + succ < 0) mdat->mirtab[i].succ = 0; + else + mdat->mirtab[i].succ += succ; } else { if(broken) mdat->mirtab[i].fail++; diff --git a/freshclam/notify.c b/freshclam/notify.c index e5921af8d..1797d57ad 100644 --- a/freshclam/notify.c +++ b/freshclam/notify.c @@ -59,7 +59,7 @@ int clamd_connect(const char *cfgfile, const char *option) #endif struct optstruct *opts; const struct optstruct *opt; - int sockd, bread; + int sockd; const char *socktype; @@ -188,7 +188,6 @@ int notify(const char *cfgfile) { char buff[20]; int sockd, bread; - const char *socktype; if((sockd = clamd_connect(cfgfile, "NotifyClamd")) < 0) return 1;