From patchwork Thu Apr 11 10:15:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 787939 Delivered-To: patch@linaro.org Received: by 2002:adf:e6ca:0:b0:346:15ad:a2a with SMTP id y10csp148843wrm; Thu, 11 Apr 2024 03:17:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUnZGPj9ZvUrkSfb4g+41Jk8viyOPnlBr8M0OzaOR95iy/5w4+aRlPA3mwNtmtOYzog3Qcq+pG2r7gkLV7i2oK/ X-Google-Smtp-Source: AGHT+IHfBGiKyO3MkZYiGyNVvddEjm1esrdqLUjn82I6lI8aya6C8HqzDmocMJx+jQsljOS6YoYO X-Received: by 2002:ad4:5be5:0:b0:69b:1cd0:e5d8 with SMTP id k5-20020ad45be5000000b0069b1cd0e5d8mr4237885qvc.22.1712830651698; Thu, 11 Apr 2024 03:17:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712830651; cv=none; d=google.com; s=arc-20160816; b=shCkG4df3KClPXwFMp9163Lk9P8iXEk1dh5Ad1aAlUb4Tu4++x17V6GOO95y/ljeXt Fgmeq7Y3u8BTUx0yBZ9eXu24TFuaOrF1nZAvJGlO5UcyQ093nk7EiSXgR1znllZs8BgO FoNcYfpL/RJqtInaim87hirDz7OYkMTqc4WiY7G7TTRx+mI9YKkJQukTVtbZGlzJwD0E YAcd2l5fD9P2MMP3t5Vg8R8zxSv7ppXraqM5QsP8wiFpehtgihd4+Bh05Tpb+HvjtSBE 3X144UodSuVqw8KJem+FlEdgrxgSgpBC9v4fsGOkZ//RqibyN+kTcCdiu7ygrZ3fEWnZ CsRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yioT4noxDvhbuL7egM0nA5pMTUC57Trd6rEmG3sDLks=; fh=nrO9NFjS9xx3FpRrmsadTA4JiiIct2qNO2tpnCWPNVk=; b=rfqm/Lx2KfyPkteZvN4KTZwBDdy6sE87/7BuEG2XZ5E32miynPnCjUF4kQr04iYhlZ 6+Jvqq/2ADdGU8FtqsT0dxERnGnYM7yXch1seB4hC48Sd5EC2gd9FLTnVtW1FVyJCftL bh9lk6UNGrP9iTjo6nt4OQILbbs6GIPd4T9IxmqYP9ziq2GkN2Uj/cjzKSPy8yt+xHRM SEH9KZitcyJvabVBEfvCPZeGbmnWS+TxIzZT432OdPEM3GmX9q4kQlNwU+9j41V/Jo2H Z0+/4ze0/XSGovoj8lB+Dkt0zzJR3u6eJpNoMUCnHSqJiK9vWUV5tldNMi/GDeVxONNd jiRw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RXlA8Nqf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o16-20020a0cfa90000000b0069b3c259088si1146273qvn.567.2024.04.11.03.17.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Apr 2024 03:17:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RXlA8Nqf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rurTn-00052h-1o; Thu, 11 Apr 2024 06:16:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rurTV-0004xS-Up for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:16:12 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rurTO-0007SS-3s for qemu-devel@nongnu.org; Thu, 11 Apr 2024 06:16:09 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-41650ee55ffso30708675e9.0 for ; Thu, 11 Apr 2024 03:16:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712830559; x=1713435359; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yioT4noxDvhbuL7egM0nA5pMTUC57Trd6rEmG3sDLks=; b=RXlA8NqfCIRGixF6bIle6C3AdW0BdiJshvhBe5wRA2l3C552fBE9NNQL/nKckc1gAK zunU+pnppiCl1TCioE9iP3M5U/kgM4FEky0qnrFsOM3lWKNJMfoz6fffkpCzK9H7nCnk OuUpM3rbjfkjxsOACd8jYbIzhMBPaF/Mm8IixiKqjZxu3F6hECQ771mWzFvyKWfqa+2D wy8s+by1GIC/FkvQO2/1fZ78QvYRIMoBhBS+SkP0BuFuzHtwYgTyWweoQrwFNoYa8w5D TNXurcnEGIgrHTtexlgWmVx/A1Lf8Y7+RaaPCCq8BVa8CEyXMwrEbUMplz1d4QAt1L46 paFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712830559; x=1713435359; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yioT4noxDvhbuL7egM0nA5pMTUC57Trd6rEmG3sDLks=; b=o9eSYhudTVUO1gOaSACeq7YFsWa6Dg/VbPpPK7u0Hd0y/V4mghuA+ltSgbFIGlRGrh weab9g3rs5pBbnpa00Gg5SSlE+/4jwld1CCeKnwNOswHKFc5lxvqV/Sl8FD0DswWEMnB SabpzkFYjq/XflOpvOKQSpFRmsH74jw772S+fjhEHW2FHa/9U8yA9THj3yR9jZjdXbTR c5Oui/IuJ6wV5buh8Hxa85uM4B7UaWHn2rtC5giVs0Tvgu4pGxOB+o7BDOoMD3BdWT6c EEjwXGDXyck4qnG5t6WXbqJ8C9ebNvKXuLUlwqX89JZHpJEfVOM7orJXxVev8fC4KmxS OAKg== X-Gm-Message-State: AOJu0YznFsjwYcvB16z+VhEUrYCarvD//Dsl08sK/CAMA7l0Z+wHYJZg VHSy8rjPH+Op6ARpIkww1/7L78P9yLuclmoWKSf+yIQNJMkUvc6/knItonsSzRlUsj4U36QrbR4 u8RI= X-Received: by 2002:a05:600c:1d8b:b0:417:e090:4772 with SMTP id p11-20020a05600c1d8b00b00417e0904772mr654387wms.34.1712830558952; Thu, 11 Apr 2024 03:15:58 -0700 (PDT) Received: from localhost.localdomain (137.red-88-29-174.dynamicip.rima-tde.net. [88.29.174.137]) by smtp.gmail.com with ESMTPSA id u14-20020a05600c19ce00b004162bac1393sm1848952wmq.43.2024.04.11.03.15.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 11 Apr 2024 03:15:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-block@nongnu.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Subject: [PATCH v2 01/13] ui/console-vc: Replace sprintf() by snprintf() Date: Thu, 11 Apr 2024 12:15:37 +0200 Message-ID: <20240411101550.99392-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240411101550.99392-1-philmd@linaro.org> References: <20240411101550.99392-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Replace sprintf() by snprintf() in order to avoid: [702/1310] Compiling C object libcommon.fa.p/ui_console-vc.c.o ui/console-vc.c:824:21: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] sprintf(response, "\033[%d;%dR", ^ 1 warning generated. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Marc-André Lureau Reviewed-by: Richard Henderson --- ui/console-vc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/console-vc.c b/ui/console-vc.c index 899fa11c94..847d5fb174 100644 --- a/ui/console-vc.c +++ b/ui/console-vc.c @@ -821,7 +821,7 @@ static void vc_putchar(VCChardev *vc, int ch) break; case 6: /* report cursor position */ - sprintf(response, "\033[%d;%dR", + snprintf(response, sizeof(response), "\033[%d;%dR", (s->y_base + s->y) % s->total_height + 1, s->x + 1); vc_respond_str(vc, response);