From: Ben Pfaff Date: Sat, 4 Mar 2023 00:32:24 +0000 (-0800) Subject: caseproto: Fix calculation in caseproto_reserve(). X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a75df68d6fc286437fc7e0fb6413d3ffa221094;p=pspp caseproto: Fix calculation in caseproto_reserve(). This reserved way too much in a lot of cases. --- diff --git a/src/data/caseproto.c b/src/data/caseproto.c index 4182004e4a..f390c3f87c 100644 --- a/src/data/caseproto.c +++ b/src/data/caseproto.c @@ -86,7 +86,7 @@ caseproto_reserve (struct caseproto *proto, size_t n_widths) proto = caseproto_unshare (proto); if (n_widths > proto->allocated_widths) { - proto->allocated_widths *= MAX (proto->allocated_widths * 2, n_widths); + proto->allocated_widths = MAX (proto->allocated_widths * 2, n_widths); proto = xrealloc (proto, caseproto_size (proto->allocated_widths)); } return proto;