public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org,
	 "Andreas K . Huettel" <dilfridge@gentoo.org>,
	 Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: [PATCH v6 2/3] support: Add xreallocarray
Date: Fri, 10 Mar 2023 17:49:28 +0100	[thread overview]
Message-ID: <877cvoa6w7.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20230302145732.2293756-3-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Thu, 2 Mar 2023 11:57:31 -0300")

* Adhemerval Zanella:

> +void *
> +xreallocarray (void *p, size_t n, size_t s)
> +{
> +  void *r = reallocarray (p, n, s);
> +  if (r == NULL)
> +    oom_error ("reallocarray", n);
> +  return r;
> +}

Isn't the failure condition more complicated?  See xrealloc.

Thanks,
Florian


  reply	other threads:[~2023-03-10 16:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 14:57 [PATCH v6 0/3] Fix opendir regression on some FS Adhemerval Zanella
2023-03-02 14:57 ` [PATCH v6 1/3] linux: Use getdents64 on non-LFS readdir Adhemerval Zanella
2023-03-02 14:57 ` [PATCH v6 2/3] support: Add xreallocarray Adhemerval Zanella
2023-03-10 16:49   ` Florian Weimer [this message]
2023-03-10 18:44     ` Adhemerval Zanella Netto
2023-03-10 21:21       ` Paul Eggert
2023-03-02 14:57 ` [PATCH v6 3/3] linux: Set internal DIR filepos as off64_t (BZ #23960, BZ #24050) Adhemerval Zanella
2023-03-10 21:41   ` Paul Eggert
2023-03-13 12:40     ` Adhemerval Zanella Netto
2023-03-13 12:45       ` Adhemerval Zanella Netto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cvoa6w7.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=dilfridge@gentoo.org \
    --cc=eggert@cs.ucla.edu \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).