X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=pRb8uFqHeR7cMHZLfc0tBMH9woEADR/WAdscc3Yk65o=; b=pbV3QLFbp5wmAtrZNnuvEd4EuqH9txrGCVCUiwxABJuFSU/pm7CcyWltp2vf8AVU8h jb7j2shsa4/Px00vMRMEChCxlWpFcfXK8CAL7/DebywbYOArjvM0W7UC6/BDCQmCJeys WkBEdicur4ewx46gjXTJi2dBu3sEcXqu+JvMxEXbb3SeYUNcUtVAjk7if/rfZS7uu9xt r4fjBrP35EfXy8RcqLElmA4jNk25samN8D7PTqE0bjhLv/ybKeBi3StqH+DqVVF+rPlP 0jtTfN7jlnymKbMub2H3eOslRSJK6O7To0kQZm7Z4zZt9sBRoeR5Ihk6dAf5xzZ2t+3I 0Nmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=pRb8uFqHeR7cMHZLfc0tBMH9woEADR/WAdscc3Yk65o=; b=YVPZ/SxqHZRM712v/Nmqmrwf97eZO0H7z4ZSxyHOwx/8Npe0NftqDOCAGqp2XPSe5T 3i0Y2oT3KyT6AyScbte1ggJJPQzLnh+BeNRd7NKUdXesq6i0TyRJbrxJGDeCRwvZ/Gs3 3NvY3de82+L2/iOiAHNfcvXpoXp1WAECbjakSEamtBYBFOurFw3u7vY6WbEtTioQqB2q FjjDefkHJpf+MB9kR+pSAErCmyppVsYezfCOxPHSgPBHGM29QdMH7nPzb/3A5bakF6Wu HjWlV9cJ60YpWP9uCpNNMAbT8PGWOM22MY9BQuY6p3bYZpsFwn4INNrm1Z0wDUPEHUAx Y3aA== X-Gm-Message-State: ALyK8tIyXUQO+bOhWA2NFliW7CWvIvw6VOsvwN9XCC8Wd2s1zFuijEDNMJJIEt+EnCgrrfrFRH5zVWe597qYag== X-Received: by 10.107.48.193 with SMTP id w184mr41811372iow.140.1466583012768; Wed, 22 Jun 2016 01:10:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: "Ozkan Sezer (sezeroz AT gmail DOT com) [via djgpp AT delorie DOT com]" Date: Wed, 22 Jun 2016 11:10:12 +0300 Message-ID: Subject: Re: djtar/unlzh.c bug introduced by whitespace changes To: djgpp Content-Type: text/plain; charset=UTF-8 Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 6/20/16, Ozkan Sezer wrote: > While reading the recent gcc6/-Wmisleading-intentation changes, I > noticed that in read_pt_len() of src/utils/djtar/unlzh.c, the > whitespace changes from 2012 (cvs r1.3 by Juan), a bug was intoduced, > where c should be incremented in every iteration of the while loop it > is now incremented strictly as once. The original code was: > while (mask & bitbuf) { mask >>= 1; c++; } > > I suggest applying the following patch: > > Index: unlzh.c > =================================================================== > RCS file: /cvs/djgpp/djgpp/src/utils/djtar/unlzh.c,v > retrieving revision 1.6 > diff -u -p -r1.6 unlzh.c > --- unlzh.c 20 Apr 2016 21:45:00 -0000 1.6 > +++ unlzh.c 20 Jun 2016 17:01:28 -0000 > @@ -237,8 +237,10 @@ local void read_pt_len(int nn, int nbit, > { > mask = (unsigned) 1 << (BITBUFSIZ - 1 - 3); > while (mask & bitbuf) > + { > mask >>= 1; > - c++; > + c++; > + } > } > fillbuf((c < 7) ? 3 : c - 3); > pt_len[i++] = c; Applied the change as obvious. (unlzh.c is at r1.7) -- O.S.