From patchwork Thu Jan 22 04:11:37 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1768 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769055168; bh=5UMfQApcUB/Cql2fk3v/cXhA8fk7qfLFyuzVn+I01sY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=u/61bBwZYYKGQJBnHsDkjq0J6IN+aTc/SGpJqjQlzPk/2ZtjLyDmPxDKBYkSvcD++ LQ/qiY+rLjmIpvwZF1c4N9KaArE6+Bj/gDbrk4wCHdJcSjUFDLzPbUamfHBffYFgDO AjL8p6hvlaCj7OWmXohX3AZ46sxE8D4NSmWw+EG1XbCzKdQe7z+eeywA38AQvY2v+D yir0i11Z186yNBWqvr1pvRJzLZ2xhXhEjuiTEddtMKDwKxZ8DygJGA/sgf/BJjGDZH 1kmXmhcBlIWMPY2QOC7evveXyXJ6lKkNsMv/D1udPwKMQiY1LubMCv/704ZbrQmDc/ +NSM1+veeypbQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DFDBD6962D for ; Wed, 21 Jan 2026 21:12:48 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id lWAXOuuyZGHW for ; Wed, 21 Jan 2026 21:12:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769055168; bh=5UMfQApcUB/Cql2fk3v/cXhA8fk7qfLFyuzVn+I01sY=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=u/61bBwZYYKGQJBnHsDkjq0J6IN+aTc/SGpJqjQlzPk/2ZtjLyDmPxDKBYkSvcD++ LQ/qiY+rLjmIpvwZF1c4N9KaArE6+Bj/gDbrk4wCHdJcSjUFDLzPbUamfHBffYFgDO AjL8p6hvlaCj7OWmXohX3AZ46sxE8D4NSmWw+EG1XbCzKdQe7z+eeywA38AQvY2v+D yir0i11Z186yNBWqvr1pvRJzLZ2xhXhEjuiTEddtMKDwKxZ8DygJGA/sgf/BJjGDZH 1kmXmhcBlIWMPY2QOC7evveXyXJ6lKkNsMv/D1udPwKMQiY1LubMCv/704ZbrQmDc/ +NSM1+veeypbQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CB16E6962A for ; Wed, 21 Jan 2026 21:12:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769055167; bh=cRrgaBZGy+a39hnlehtEmBTL5AdrTyltNyqY7vfyVIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mr3gs+sEM2pQu+VH/C5bl0w2MJk89ksuwicmOH9I4yYENp0K8jC+vwNghJTGNy8cD crdbeLIdDVjGJ6gS6mirIVGwp55m283Kp/9GO4e2K7p1wi0wOHfFHK1cCsxOnD7WU+ a8Q2FWiHvYB0BojNfiyVzXGYc1q02RNdLuAbwAFWkJrBKIs7DwPiEeJD2xL62QI768 SKz6jC2SR1qNyWryF9LCZ9LpO+O2UIThU1MGQ2nSWD9x0krMboLWQw7YBFlDP4HuZy PbYERFu7t5sJEeHdFNGd9vXS3rtA1bAz+I0HPTgQ2R6trpFqW6P4iw2LE/iIwGBb30 xynO7ZnDjKKZA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 38128694CC; Wed, 21 Jan 2026 21:12:47 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id hsOBcS06_XO6; Wed, 21 Jan 2026 21:12:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1769055163; bh=LXp8BC3LFcdAlsKwK7ajfMZFLv6VHFQl1QjYlpHgb+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n3mxxKR3XValHx1YB9Wz4Sfsm7giYFNOwWAPb7qGolwG1YfSN5LdKLPA3keIs91y0 JVUPFEvBbt9IKGR0ysOH5p4RBxbYNkRATPLEAn5US/lt9BNASKoEJMkWIcZSil2AmF t8/dhTAWbcq2AQFHsvHK1XALBs8Ol2wBxxUsdXVLaHS43UrM0wUCd4MFHrnFnFMmIE wcrZaBzOVm7C4pjLixg1rqjVFhygFsv+j8ZPeY2cCXfo4SXZGwi4uLNeuXZ3CLppEZ GRAYzycTGsZSJGI2AAU30whjxjaPTFxGbwTJ9NCHe10wDYhNSlX9Odu3iYhc84cRXT c1A+r22x7X3rw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DD18369616; Wed, 21 Jan 2026 21:12:42 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 21 Jan 2026 21:11:37 -0700 Message-ID: <20260122041155.174721-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260122041155.174721-1-sjg@u-boot.org> References: <20260122041155.174721-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DSKWE6LKW7AV5UTPKGD2LIBUYDOTKO2D X-Message-ID-Hash: DSKWE6LKW7AV5UTPKGD2LIBUYDOTKO2D X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/16] expo: Fix text-input buffer size for CLI editing List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The CLI line-editing initialisation uses tin->line_chars as the buffer size, but this is actually the nominal line width for text wrapping, not the buffer capacity. For textline objects the two are the same, but for textedit the buffer is much larger than a single line. Use abuf_size() to get the actual buffer capacity instead. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene_txtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/scene_txtin.c b/boot/scene_txtin.c index 43a6c00d497..338c7da63d3 100644 --- a/boot/scene_txtin.c +++ b/boot/scene_txtin.c @@ -142,7 +142,7 @@ int scene_txtin_open(struct scene *scn, struct scene_obj *obj, vidconsole_set_cursor_pos(cons, ctx, txt->obj.bbox.x0, txt->obj.bbox.y0); vidconsole_entry_start(cons, ctx); - cli_cread_init(cls, abuf_data(&tin->buf), tin->line_chars); + cli_cread_init(cls, abuf_data(&tin->buf), abuf_size(&tin->buf)); cls->insert = true; cls->putch = scene_txtin_putch; cls->priv = scn;