shithub: mc

Download patch

ref: d7340522fdf6f9d3799546519de63db0483d6a17
parent: da7a658feb3f1d785fc557747baf9557c7926520
author: Ori Bernstein <orib@google.com>
date: Tue Aug 7 11:39:08 EDT 2012

Return the right length from tidappend()

    We were returning the remaining length instead of the consumed
    length. Oops.

--- a/parse/specialize.c
+++ b/parse/specialize.c
@@ -271,7 +271,7 @@
     p += snprintf(p, end - p, "$%d", t->tid);
     for (i = 0; i < t->nsub; i++)
         p += tidappend(p, end - p, t->sub[i]);
-    return end - p;
+    return p - buf;
 }
 
 static Node *genericname(Node *n, Type *t)
--