On Mon, Nov 18, 2019 at 04:46:45PM +0100, Patrick Steinhardt wrote:
> 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 = &((jsmntok_t *)json->tokens)[json->idx];
> >
> > 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.

Works for me.

Daniel

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to