From patchwork Wed Nov 29 20:51:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Storm, Christian" X-Patchwork-Id: 1869846 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=BQpo81Lt; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::f3b; helo=mail-qv1-xf3b.google.com; envelope-from=swupdate+bncbdd6bwv65qpbbz6it2vqmgqer2tok7q@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-qv1-xf3b.google.com (mail-qv1-xf3b.google.com [IPv6:2607:f8b0:4864:20::f3b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SgWht5pC9z1ySd for ; Thu, 30 Nov 2023 07:51:57 +1100 (AEDT) Received: by mail-qv1-xf3b.google.com with SMTP id 6a1803df08f44-67a45d04eb0sf2383706d6.2 for ; Wed, 29 Nov 2023 12:51:57 -0800 (PST) ARC-Seal: i=3; a=rsa-sha256; t=1701291112; cv=pass; d=google.com; s=arc-20160816; b=N+Ox0lk10ZY8l+An8KokW4zkq4xLMhl4wPHun0OIrZOhEc/m4oWPnr6v2XsgbRfo+w /fhcHolRzEcF90y01EhhVxG8AyXJ+XQNgBsvxeeUFWjydAs4pKWafISTjCy3HnuBrD3y HWUeQTc6fIkXw5KrspysztGBsl0EV5VmH6FYT1OsNArkrS3pJU+5gzPSeAAcD2n3e4tu Slo66g8ATAUXMiXC0OPI2y/yowrjDDEXpPZIBuX2N0f8UraQ7MRFK8gmif9t+1PyE0Or sP76TNpVHe98FPI75fy+v4g7VCuv/DcmWRAYvyk4CXaXmzLkMjrNsfxyNSGPRDkbWQqP Izrg== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:content-id :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=1W1tWBwT6oOd+Ob0x+4/vFTB1zXujHv0ljVng3U4yFA=; fh=2tvpxRRfIuRPTbnjmL3GwjpmyYmM4mwmCnoaAF2Uc6I=; b=uSnlwm2IglWPOUDtYDr3k6fQiB/SpuaDTc8i8H0TNoJqSxA2pI4pVLtibeXNHSR35D vc35XMw8l86YzuicLT4iqD5dOH78Ts+wTx9F6H0e8TFLwmI81LSFNzwZ5PmtT7kvTz+f VWZql5W7ve15ZkB+XMsqbtKaQr3YQdYU/TaN6s3OIhzt3+SmpJMfzF6Dw89+ke8oxk1h l6XvQ5tV7HIS/V1RgMUyvw/7P+0sP08WlsQRyIVoliurAGY3i9VonVUe3ueByA127/SN AzEquBccdwwioCcXuynml8T4Pc0KyWLUKU/gppOTGIAWoUQWrr65H7SHQBU87xGuhSez rXkw== ARC-Authentication-Results: i=3; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=vvQfoB0B; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of christian.storm@siemens.com designates 2a01:111:f400:7e1b::61a as permitted sender) smtp.mailfrom=christian.storm@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1701291112; x=1701895912; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from:from :to:cc:subject:date:message-id:reply-to; bh=1W1tWBwT6oOd+Ob0x+4/vFTB1zXujHv0ljVng3U4yFA=; b=BQpo81LtL48zvbBFc1TvcVRPE/PRT8k3COlj5+LFPhxQbEQwV2hlqbvHZy+WZ5el7D sPNQzyyOK8pByCzQ2BXcld4vguShaQuDLqyrPB7SgdZ7m+hWq9Vdje+mWxqUQ09fk6xi nIIqglrFhyj5dJjtCqVUEgYRebk+pzjEPoxJs21waTewi3Gw35HqO6ziMtPzdRhg5KqN TKxGEI8lpzGjskhj2HciChMAVKxFatVGQEvY0gb9bHX/YSnsDTgO57wp5DudXK7B+Imt Z/HsaDZBSFHXHpD/VwXca1fw8mYPtfy2QG/3VV7WX6EwfJq2EPGK/tJWetmy0M4Bv4D6 1sdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701291112; x=1701895912; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:mime-version :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :x-beenthere:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=1W1tWBwT6oOd+Ob0x+4/vFTB1zXujHv0ljVng3U4yFA=; b=mUTShtX2TNeFZjbUgGGfWj1WgyfCGJL70DjWu0bq6IK9VYRDHARQO0sZnIiW34YHYn 6rFlmSsXyEUnzjn/+7FrCpCX6GEz94Fj4aHz+Gs1hr8Ktu+/P11qtj3W70CHz1aI/2le M48XdHKRk0uczMJTVAWegiUENhGH1dI+tCtclZQlOK7Mhzq5FQG/b8SwuzIzx+TLLC/o lTEZrh08FY0u/kbeZpNAaOd3nMiKQzSmizWjNba65jr75sUdGuooKNRSPO4+ZBZjfBM5 EwXHevIqxEWM1fA7PFalLqNx5wDyl0ZFwrqJ6MfIX4VrMX8iyFIrN9OkmUf2dndU+nz1 w0yQ== X-Gm-Message-State: AOJu0YwTjgc4aQGZPF4LgWGPeBTJqaDMeuRWOD+kX08Y1WPCKhH+BFoi C+Apm7H6hGH1prex5Iq2XHg= X-Google-Smtp-Source: AGHT+IHhJSrcULP7K/6c1avivF3aIsf/viBg7AWemJ6hoBapRi5qKiLXsEKYkWmLqmWkOBWFT8Qskg== X-Received: by 2002:ad4:58e5:0:b0:67a:2c08:48be with SMTP id di5-20020ad458e5000000b0067a2c0848bemr14004560qvb.33.1701291112146; Wed, 29 Nov 2023 12:51:52 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:ad4:4ea7:0:b0:658:9457:9887 with SMTP id ed7-20020ad44ea7000000b0065894579887ls223095qvb.1.-pod-prod-09-us; Wed, 29 Nov 2023 12:51:51 -0800 (PST) X-Received: by 2002:ac5:c396:0:b0:4b2:919f:9c5f with SMTP id s22-20020ac5c396000000b004b2919f9c5fmr1882542vkk.15.1701291111326; Wed, 29 Nov 2023 12:51:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701291111; cv=pass; d=google.com; s=arc-20160816; b=c3mfWJXulAb/gtHqJ4KsDmfS/VKv1SnuuFeVKfuAkOOMMat9v6VjkTlmwBmksTf+Oi vEfGkuDCuhXUHMHT7PpbCLM4um9TzuYVG4ZA85qQZcP51ktF0AGyIlnDcVv0gUhRjMLB KIdHbV/Z2JWbKyEW5j6m8g0phcYNbqCAl8KC/BP9p3UnbI6j9SgNXRfrN+wBhb6EM0/5 YnFv/kOGcfORn0Q4SCJdehzNNk76XQ9A54UhcljuzBHDO5K1dcGjxN2mMiQbHBcVZfHH GY5jm6oNvh158/ATPwFSxP20pzZa/HTuTamIvdOk4VCgzdJyNU9Elxj/Cgkjr03P01cA xkOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:content-id:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=tEIJ8CCedkMGOD3EqTkx3GlB4QWr+eC2ryuEXr7i4lY=; fh=2tvpxRRfIuRPTbnjmL3GwjpmyYmM4mwmCnoaAF2Uc6I=; b=qYh1cMPwq13IFmHqtJDsMD5AHfcQzOH5g9wBNROaZI+SCbXt20mHVBamcd8vKkr6dG Y8X2DBxXY0wY/A6WK6oJiRhPxB4sU+osZo/dTvzAiVN7UChaWQrBU2nln1uTkEsY6Ax5 dgYsWjY6/LB5/QkQc9txyxzegraFU0kT7P1kMi5Ct2Yf0tzF4wteDSlUaD1deA3ZQi4l nnuHcnPzWTr7QRfNhaMC6G1YZwFWDZS4D9SQ1ktzEkEZz9kf4GDCd4halPefcUTcRnPJ Q8oyufSgrU8rPryPJ8/Bcuws/SkJhL8UmEGBN6SRAXoZ+DbKjqsCo24bWpSFa7+E5/xC O14g== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=vvQfoB0B; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of christian.storm@siemens.com designates 2a01:111:f400:7e1b::61a as permitted sender) smtp.mailfrom=christian.storm@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2061a.outbound.protection.outlook.com. [2a01:111:f400:7e1b::61a]) by gmr-mx.google.com with ESMTPS id ca28-20020a056122401c00b0049d13f0321fsi1789034vkb.0.2023.11.29.12.51.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2023 12:51:50 -0800 (PST) Received-SPF: pass (google.com: domain of christian.storm@siemens.com designates 2a01:111:f400:7e1b::61a as permitted sender) client-ip=2a01:111:f400:7e1b::61a; ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gelM/UXR7Q4MI7g90817oEuJdKScODgSrbXIxYE0OvoBE5Rd2oujwVOCut2i19XgWlJq8jOyRO5UTH3Ytj42SZVEA79Ts4PmCDscQFDXFKs5NKSfQw1Ng4HgdkdNnMXBp6E41/IhV860IFhBkCn1O7P3iRwamhBi3fInaTVgPhMx92BmsEGtyRHWPeXsNCRG5XThxIxcl6l6mBmUB7Y1bY8T8d0Tt375CwrX4z7DZIltccHOlafwe5XrlVlcHQQ+epUhtcwy4wUed7YFVgAYROrWUmPN5G8n3GmzWBfBCWRLcgJoOFy3tiVDGRXRffsxD/e1TPq/JElVdEOfuUEyRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tEIJ8CCedkMGOD3EqTkx3GlB4QWr+eC2ryuEXr7i4lY=; b=hZqqtifZHDe/b32q4Yoh7hD8AvN7v0SSzjsTkWEIcNKpoTDAbnW7gQZJDpflICmblUluRiP/nHHAQNVHoWgjo3DrWfHuMGXuZH2oyP2MXUXZrvRlncXOg4s5pUZbh+vYqSRsbth5R07XvFycMaTGgYTpdVHM+u2VpxUT4DCjms83XksKOcRvGIVJIwLH8O0BTPu0z/GGkfe9g/BLm9iTFMhiI6+lOKGb4/bpGKzi8zHNWLNrjkc1/bZqWWVuaaah9MUX452JmWyIzvkze4jw+imtc1jxre7fSAXYkF3tzbg05ieP1FRANfyEMHsCZQzgCTnBYKaHnBPAb007pVMsJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=siemens.com; dmarc=pass action=none header.from=siemens.com; dkim=pass header.d=siemens.com; arc=none Received: from DB9PR10MB5404.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:10:333::17) by VI1PR10MB7736.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:800:1bd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.27; Wed, 29 Nov 2023 20:51:48 +0000 Received: from DB9PR10MB5404.EURPRD10.PROD.OUTLOOK.COM ([fe80::4883:a6f3:3843:93af]) by DB9PR10MB5404.EURPRD10.PROD.OUTLOOK.COM ([fe80::4883:a6f3:3843:93af%7]) with mapi id 15.20.7046.024; Wed, 29 Nov 2023 20:51:48 +0000 X-Patchwork-Original-From: "'Storm, Christian' via swupdate" From: "Storm, Christian" To: Stefano Babic CC: "swupdate@googlegroups.com" Subject: [swupdate] [libubootenv][RFC PATCH] uboot_env: Emulate %ms in sscanf() Thread-Topic: [libubootenv][RFC PATCH] uboot_env: Emulate %ms in sscanf() Thread-Index: AQHaIwXeb9t6x84DfUam55p52wTmnw== Date: Wed, 29 Nov 2023 20:51:48 +0000 Message-ID: References: <20231128180938.532132-1-stefano.babic@swupdate.org> In-Reply-To: <20231128180938.532132-1-stefano.babic@swupdate.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DB9PR10MB5404:EE_|VI1PR10MB7736:EE_ x-ms-office365-filtering-correlation-id: b2a5fed5-dd2c-4ff4-c97b-08dbf11d0178 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LQMXCawNreW4AIXHRbxdpesgnB8ueP0lFSAQdOvq16FcaaMHeyQ3BwtdUvxeUbCcqw1Q/AjsGz1zE4pIm+RekPJYbTcg6iyL85DUCb2TGhguDqGxX31I9OEvrMT9PJOxno4L3HM/erXiZ9/5Hj273B5D3yN1vANp09IdSqyW1WSnlFVn4on4BkrG3nvVcXaSVeG81iMRGIcfMbuo2hvvuAcpzfCXFuA94sPW4UcBSOo2Fy0sp6m8jRpYqq+2QDewciOzng1DbqMvZjYcG5P9tG4ooLppIhF0M0VIG2xhGq2Hzo9lnT+Ua0hU/v8WGEs7UTmmUt8aApN7d8fYqsbz2VL1AV+LKXgPAHZg55SeO0H6zDv7pVV2NCOYUZEz9GB/Qwpxf4r74SIGT35+ZX1dckbJb4obdm4s8jTa8o6/tHzD/LIH/YxpONGlrvBO4pCLiljv0VyUIn0jagWs8BvPLac1Rmg1OBNIXZqC0RV6UyEAwTdFizu3VpiEM3Zl5U2zI667RfmhMruJY/G0xsaDWAmYi2OhCS+bOiq0F0BzZeSOTYupQTAklUKkFcJhM+YtUDiiO0hrzbSFIgEkRFwg5+sAz2QtC7jYCVMPt5jui7yON/Wyschk4UJwr7K2ThCFyNRV0FFoaWKAAXM45RuwZOnh92ydqoLjzhvYCpQZoLXTJXIKRu2PUG7aAaqEpm4u x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR10MB5404.EURPRD10.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230031)(366004)(136003)(376002)(39860400002)(396003)(346002)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(41300700001)(38100700002)(71200400001)(83380400001)(2616005)(26005)(33656002)(86362001)(36756003)(82960400001)(38070700009)(122000001)(202311291699003)(478600001)(5660300002)(6916009)(6512007)(6506007)(91956017)(8936002)(8676002)(4326008)(2906002)(316002)(66556008)(76116006)(66946007)(64756008)(6486002)(66476007)(66446008)(45980500001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: DxiAWUDhlhPZKGT25ePFEQpKP7bFCJI7cUBVNJeRmOjzBdyPLOM9dOFsZ7rdJh6c+/iH47nPPSLgY54AclaumNAP3zj1wz5FMgpltwBU1tZJWvFSTz5XVRqj62FSWJVnJo3enBAYs3divnDYi8c4B2/371hB0vO8QA+q2CZ2vL2GNx+1GpX9ibZfjikbijUbUT41CXWX5s/fXxuVCpE4t85Jiv6lnev9inSmIhXerziSeDeB6yplqKy0G2f/UY4Amj4NXW1ENlw650LnJtDuf+Gnr9IuYBP7sByIBLuB/UdAUuZTnNqtIk/M3XSXDhHD4AisjKGck267xr8kfpDaex4QvDpgR4Hpv/nxaCQIrdz0NYiImyP+MIy4CkwlL6lRdY3Wo8KG221ZeMAmlKUZhgPcpQcMQgFLmAbR5gyx/3WaoMIGC12DDHC6P3asAEaaxQ/cVPRK1hKPWGrIYM2yRFCkHSSZmxbRqkOLc6+EvLsex4WMeC5ilbayVPeBVljOH6Ufm6XLxlL5duuGM6YzlOUThlHSSWG2fFza4p3yOP0c8pu3XFiywI0ROfpsD1JZCq5m3LNQM3zf6em5vxEu95wI3KdW6SqbzWzVM6jVQtokxgjjq2Nre19mIey+ZVacR4D7vxRJfyPzBdUp7adckb8pPV9G3aFswi0b+XPE1skCC8P3Sv5qIW1hfzSDrJvO6wiv+y57ZSY4Zd2TUbYeFqVxNL+fXD9n/p4NReVzBl4Ol8/PxIyIk+GLwiUYBOzDy4LX//xPlbb5n1318X8kNmdz1kyAypSyWH/GYmSJyDFOatDwGHE9O+tlXlX9zXZp7b/BHUF6b+Ckf5yD1FC8XLrzoGb9hmlI0ARpqe7haWnkN/gay0qF5iyAHw+v61a+tLUMMDwMJGzR7yvIjfHBF/QRMW66HALFnjiqRmAkv9QtwsY62KsWYcFPs1wwikj91mAVN33ddwZlt8QMPFzF0Da+/1LD+prCiDeA+/6NP4fDVgLki/tj0axUzk3nC1i7PdZ+nQ5lu98rwdE9eLUyjlJGWsZopIUzFHCzW87ybAXz/WLHXTAXeIyGv8rVhV59YX5lg6O+pcJ2+qE51vnhwjqFutn/oLrirozBXP1OGQYOumu140XgijZSiy/hUOsWesltv9uDfPA82FfHnq4OrLmsZ9wLd9nqLexCmfVDk0BDgTW9lblHQyiXtQuMb3Z1IntIT4A+xqCYXWUY4j4GJT33loNK84dY+RmNBvCJHbNeoaXAYr5ea1TYFlK1yFwVWlGxdFIvcPpXcWZOxxViJUNoS1HpU2NlM33dJwmHMma/1lGxidhwPQlfbY7ZpgV/08q8tBQuT19iAKmhvdVcNd1W3TPYLqfwxfTHZ++50Inja920JVtn1b6PxcadYmO267L1kCIwW+JBwuvADU/hXfJEa9ni0vVoCnUyWvhr7DwfhOAZi+W/vUyl5qhCoLMliv/Z035IKuLy/XjS4N/RHhv/3Y0uZf4OlykgBb4b8pHAhNHwCjQ0t8DJZHkpQpZjZ6apgAiimpAxJVw6ac9c4yUJSl07b06KOfldNpKnHXUUjvvtdqcRUi2PMdWJS3o/+E9fmk39G2qX19/6CcXgPw== Content-ID: <1DDC321A44097B4BB574DC44DBF0A399@EURPRD10.PROD.OUTLOOK.COM> MIME-Version: 1.0 X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB9PR10MB5404.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: b2a5fed5-dd2c-4ff4-c97b-08dbf11d0178 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Nov 2023 20:51:48.3606 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: zYPBnxtnGduKSyP4WfdK4Thl3/AoAdelEO2MqFiGeyExWLHHIHpltd3+H/PeW/RHUyXX+KcmQYmAt8unFSaq4LP7Zm0ehNoiA1s1Br/Pou8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR10MB7736 X-Original-Sender: christian.storm@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=selector2 header.b=vvQfoB0B; arc=pass (i=1 spf=pass spfdomain=siemens.com dkim=pass dkdomain=siemens.com dmarc=pass fromdomain=siemens.com); spf=pass (google.com: domain of christian.storm@siemens.com designates 2a01:111:f400:7e1b::61a as permitted sender) smtp.mailfrom=christian.storm@siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: "Storm, Christian" Reply-To: "Storm, Christian" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Signed-off-by: Christian Storm --- src/uboot_env.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/uboot_env.c b/src/uboot_env.c index bb14cab..7d3264e 100644 --- a/src/uboot_env.c +++ b/src/uboot_env.c @@ -1258,13 +1258,25 @@ int libuboot_read_config_ext(struct uboot_ctx **ctxlist, const char *config) ctx->size = 0; rewind(fp); - while (getline(&line, &bufsize, fp) != -1) { + int len; + while ((len = getline(&line, &bufsize, fp)) != -1) { /* skip comments */ if (line[0] == '#') continue; +#if defined(__FreeBSD__) + /* + * POSIX.1-2008 introduced the dynamic allocation conversion + * specifier %m which is not implemented on FreeBSD. + */ + tmp = calloc(1, len + 1); + ret = sscanf(line, "%s %lli %zx %zx %lx %d", + tmp, +#else + (void)len; ret = sscanf(line, "%ms %lli %zx %zx %lx %d", &tmp, +#endif &dev->offset, &dev->envsize, &dev->sectorsize, @@ -1274,13 +1286,20 @@ int libuboot_read_config_ext(struct uboot_ctx **ctxlist, const char *config) /* * At least name offset and size should be set */ - if (ret < 3 || !tmp) + if (ret < 3) { + if (tmp) { + free(tmp); + } continue; + } /* * If size is set but zero, entry is wrong */ if (!dev->envsize) { + if (tmp) { + free(tmp); + } retval = -EINVAL; break; }