]> err.no Git - varnish/commitdiff
Don't explode on trim's to zero size.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 19 Jul 2006 20:06:18 +0000 (20:06 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 19 Jul 2006 20:06:18 +0000 (20:06 +0000)
Real fix should (maybe) be to callers

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@507 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/storage_file.c

index f623d6adb0c8b6869551d41d4d430c830f3122ac..2aedafd15f89a2e8e140598732a5833fbb4f7b74 100644 (file)
@@ -507,6 +507,10 @@ smf_trim(struct storage *s, size_t size)
        struct smf *smf;
        struct smf_sc *sc;
 
+       if (size == 0) {
+               /* XXX: this should not happen */
+               return;
+       }
        assert(size <= s->space);
        assert(size > 0);       /* XXX: seen */
        smf = (struct smf *)(s->priv);