From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 9657 invoked from network); 6 Jan 2022 09:08:19 -0000 Received: from 4ess.inri.net (216.126.196.42) by inbox.vuxu.org with ESMTPUTF8; 6 Jan 2022 09:08:19 -0000 Received: from mail-pj1-f46.google.com ([209.85.216.46]) by 4ess; Thu Jan 6 03:59:14 -0500 2022 Received: by mail-pj1-f46.google.com with SMTP id oa15so1093973pjb.4 for <9front@9front.org>; Thu, 06 Jan 2022 00:59:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney-org.20210112.gappssmtp.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=f/LBpN++l0ixzlYv4f+FN15yJN1w7lvZ0c6TJepCmSc=; b=uwKTs0oZ1M0ByK0shW5d6JxqB3XZp0tmDy33HqE0r0YH5wVknC9E2LVc+E4hhKKDyM 0HVNREBCtj/ys/SEAVOftt1U2eHCUwfcGoGRBTJ6HSSRpvclo8/xM0t9yDJtSQmzoREw qrUzUs01KlFO+CHkCv7JPAgblg41SmkMqVxj+sSRhT9/FMnACYJMRqLDF78KamnM67Yi bJjvLuwiQIvMldlZ9b/g73QnR+cdPYN9hKdvZgJYxKUaXpSvgYyc00gtDumNZV1JrkcY yjgd+iu5phk2ZwRjHvuxf7ORtL09pQnNNe6vMjIvk6YKcQ7Cxri+0AGYbep9owvhSB0m Hrog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=f/LBpN++l0ixzlYv4f+FN15yJN1w7lvZ0c6TJepCmSc=; b=pCXmyNFCETj3fkPHFcR4iegeSfpqCzQ9K/lliddxGPIbu7Ig9bLawmd6kAArXWgkcD i3Gx0bgQIAcE9gCULGU4RQ1VCIfeuyoryuswyhNc3TMwte2trwfPMI9cPUqLS/RwytsU PqT5qgr6c0K/Aa2WLJzpN+ME+XTaUr2aL80JSbOTOjELwfsvzFjGRDI+YJWALY3Rud8/ FrrBF4OokdFy42wytnjty9ixNUS4h9QOY2ZdBXLv9VeiRJko94oPR8XAhpggYuefb654 dHctx+Y0GRSSjRP4sXLuD/Db5qPNKOeaq1zi1iUum+LzGKiWnhfxK0FszsyPUVpVnBXz /znw== X-Gm-Message-State: AOAM533kprjCvUbBLVVcIunfVrb761DSsrE5ilxGjK1B/FFWbQoR8NZj 4YuMOI6nbALTG474/xRt1aoDwWEP+zFG8HFdewo= X-Google-Smtp-Source: ABdhPJw/VsoEq0El72N1LWMk4OZLME+ln1CN50Es8f76csrDMxp7WNM4job1n6FqK74GLfmOyVo/+g== X-Received: by 2002:a17:902:b206:b0:149:3b5d:2b8b with SMTP id t6-20020a170902b20600b001493b5d2b8bmr56312429plr.162.1641459542664; Thu, 06 Jan 2022 00:59:02 -0800 (PST) Return-Path: Received: from localhost ([98.45.152.168]) by smtp.gmail.com with ESMTPSA id oo14sm1437987pjb.34.2022.01.06.00.59.02 for <9front@9front.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jan 2022 00:59:02 -0800 (PST) From: Michael Forney To: 9front@9front.org Date: Thu, 6 Jan 2022 00:58:44 -0800 Message-Id: <20220106085844.1385-1-mforney@mforney.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: secure virtualized rich-client-scale event plugin-based framework Subject: [9front] [PATCH] git/fs: remove trailing null bytes from parent file Reply-To: 9front@9front.org Precedence: bulk Previously, due to the way the size of buf was calculated, the parent file had one trailing null byte for each parent. --- diff 370bfd26ce5ffd9a06a314a20d1691cc6b15b712 2a5737d2ef4ea7920f6d4e5f47487837568b751c --- a/sys/src/cmd/git/fs.c Wed Jan 5 22:38:56 2022 +++ b/sys/src/cmd/git/fs.c Thu Jan 6 00:52:21 2022 @@ -380,8 +380,8 @@ char *buf, *p; int i, n; - n = o->commit->nparent * (40 + 2); - buf = emalloc(n); + n = o->commit->nparent * (40 + 1); + buf = emalloc(n + 1); p = buf; for (i = 0; i < o->commit->nparent; i++) p += sprint(p, "%H\n", o->commit->parent[i]);