From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iWjEr-0008RC-Jy for mharc-grub-devel@gnu.org; Mon, 18 Nov 2019 10:46:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40661) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWjEp-0008P5-Bq for grub-devel@gnu.org; Mon, 18 Nov 2019 10:46:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWjEo-0006Cr-5N for grub-devel@gnu.org; Mon, 18 Nov 2019 10:46:51 -0500 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:42041) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWjEn-00069K-3y for grub-devel@gnu.org; Mon, 18 Nov 2019 10:46:50 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 187056D4; Mon, 18 Nov 2019 10:46:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 18 Nov 2019 10:46:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=U+fxs/b3JPS/FjxkOmBf9+RNOOl OwKylP8HqjTLx7CI=; b=OtCPWqZBtK0AhnK1XpFcMEn9JPL6jnMXHT9cnsxAjXD 7WTiCYfOioOuH7yVe3yNrxzOtOfg+wt7kWZrkce2ezxZJuI9hmW7xZWzKlnC38KP evxm40UlmajUhFozaIzzfaT9QwWj/sGLcEky7r4n8FA9oVApdRJFWQF5Qx6bP/rS NyB4ssWojxZ9iuyeED7dhUVVjv79UgaNOmury9gOhUZydQmJXSjD3YpJ3NeYV7EE l1/TbNJvAbJYRiUiut5Asv86Crdoom+SDqG694l7UI43nNqA+ypZ1qcG2wUXeJ2L UzWQdxRb31PItd74t/nz+M45mOM9WzIcQ5X7mgWwfew== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=U+fxs/ b3JPS/FjxkOmBf9+RNOOlOwKylP8HqjTLx7CI=; b=AwKzPEPsZBPUBORCv9Be1j czDYYr/qaELfaqWw/SXSbVWiSZt0bS9JZfgHgJ/zXn5YgNtevyD8HwMKePqW+KSx 5S1yMEFX2Yi6YucBzMIMeNxBnnQHZu4KBpHo1ZR9yrcZzZe4JFUkJ5mZIqyhSGHj bpFqU4JCe+vEwxPq8cJk+PNA4y/hzkqz583AK7WQ1FkACqraAHE+9bcLdZ7a4IWS txtUySAlfVw7zh74Qj1G5HcUWS8X1Wmc4by7VSDqTImbHOBZZw77rQKsas+lQoyN 97pux1RMBBSbHHda1uBDNBquH3JBGWjdVExKIsvJIf/XT1OV7V7GWhynmpM3PFEQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudegiedgheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucfkphepkeelrdduge drvddvledrudekudenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhen ucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from NSJAIL (x590ee5b5.dyn.telefonica.de [89.14.229.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 1834F3060065; Mon, 18 Nov 2019 10:46:43 -0500 (EST) Received: from localhost ( [10.192.0.11]) by NSJAIL (OpenSMTPD) with ESMTPSA id 019dd8fb (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 18 Nov 2019 15:46:40 +0000 (UTC) Date: Mon, 18 Nov 2019 16:46:45 +0100 From: Patrick Steinhardt To: Daniel Kiper Cc: grub-devel@gnu.org, Max Tottenham Subject: Re: [PATCH v4 2/6] json: Implement wrapping interface Message-ID: <20191118154639.GA9603@ncase> References: <126fd84083df0ec3c03106b634b9884993eabbeb.1574066413.git.ps@pks.im> <20191118141415.nlvlifyjgfdselyi@tomti.i.net-space.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xgyAXRrhYN0wYx8y" Content-Disposition: inline In-Reply-To: <20191118141415.nlvlifyjgfdselyi@tomti.i.net-space.pl> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.21 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Nov 2019 15:46:52 -0000 --xgyAXRrhYN0wYx8y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 18, 2019 at 03:14:15PM +0100, Daniel Kiper wrote: > On Mon, Nov 18, 2019 at 09:45:13AM +0100, Patrick Steinhardt wrote: > > +grub_size_t > > +grub_json_getsize (const grub_json_t *json) > > +{ > > + jsmntok_t *p =3D &((jsmntok_t *)json->tokens)[json->idx]; >=20 > I still have a feeling that you should check at lease *json for NULL. > If not json->tokens and json->idx. However, then you should return > grub_ssize_t. Ok, will change. I'm a bit on the edge here, though, as the interface is inconsistent with all the other getters. Should we maybe use an out-parameter instead and return `grub_err_t`? While it'd make the interface a bit more unwieldy, it would be more in line with the rest of this module's interface. Patrick --xgyAXRrhYN0wYx8y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEtmscHsieVjl9VyNUEXxntp6r8SwFAl3SvOUACgkQEXxntp6r 8SyjnRAArtY+PWiJHZDj6mk3Jazw4DdQ96othIrfGKjjS4y6eXQ+aI/bvIhy4DG2 tywK3wgY5Pzop80+bFrcKwURt0Fk2114thAlDhULSPGVFRx4ZE6JgofAOKgBdfOs wHQLQ56lBXbTA6nJ+edbwb2FKjsAoSf0azkSQBOwqF+dai4ucPUzqtqKNjgbpNE5 k0hpE3Ykq8pBAWgI0QQ+5mSl5qbWxi/nJYkF2E2zfBevl0SU/fiPjybOymi7cZqW X0mW5/9OXeZJV5LuxtfJtRbCdXzDfw2MoIaW9667J85nduFEhSD+LTipv3Ytb6zy 0ohmcVPj5TT68PScl1hyU0h707rfvCOPkSyBiFrptfJNxakoY3KFCcuX3X4+CeoE gd/3aRCLEl7wVg0sF83PxUDNo3cXk5t2Ws/tUpgU0ngGSIkVXDRxjpgU4kBGz5or LEG02dt4CvO9zIwTx6wn57B/tU6EBXEAVbBDisx6Nd49RA7Phwg6XCDss5lifP7P zWIF+nPGE2lEfMdqj+tcObzu08Bzl2LOl1EvPDpRymGYA0j8WGQjBGKJmKuVxrID 5j35e+cKVADinuFnG3K5437vBi7maK3HAnhHwsIhKP1FwbNl9FAfm7P//ikkQEYk ceuQNzd0h0pt4mwKURPYoqwpQDwzx84TPCh8AsASK9yoVylKY1g= =SwG2 -----END PGP SIGNATURE----- --xgyAXRrhYN0wYx8y--