From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 Date: Sun, 23 Feb 2020 18:36:39 +0100 From: Alexey Gladkov To: Linux console tools development discussion Message-ID: <20200223173639.qf7fwnbxa6dihknn@comp-core-i7-2640m-0182e6> References: <20191206165759.81e4f6e3b62f22433ef27c65@urjc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191206165759.81e4f6e3b62f22433ef27c65@urjc.es> Subject: Re: [kbd] [PATCH] libkeymap: Fix mk_mapname for the plain map X-BeenThere: kbd@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Linux console tools development discussion List-Id: Linux console tools development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Feb 2020 17:36:43 -0000 Archived-At: List-Archive: On Fri, Dec 06, 2019 at 03:58:03PM +0000, Javier Pello García wrote: > mk_mapname did not correctly return "plain" for the plain map > (no modifier set) if it had already been called, as it did not > correctly reset the static buffer that it uses for the map name. > When mk_mapname is called for the first time from the first loop > in lk_dump_ctable, all is fine, since buf has not been used yet > and it is initialised to 0. However, when it is called again for > the plain map from the second loop in lk_dump_ctable, buf already > contains a value (left over from the last iteration in the first > loop), and then strcat appends "plain" to that value instead of > overwriting it, resulting in a bogus value. Thanks for report. To fix this, it is enough to replace strcat with strcpy. Fixed. Thanks! -- Rgrds, legion