[PATCH v2 1/2] xfuncs: return NULL from xstrdup_wchar(NULL)

Sascha Hauer s.hauer at pengutronix.de
Thu Jul 18 23:40:49 PDT 2024


On Wed, 17 Jul 2024 09:28:42 +0200, Ahmad Fatoum wrote:
> strdup_wchar, strdup_char_to_wchar and xstrdup_wchar_to_char all return
> NULL when passed a NULL pointer. It's thus misleading for the xfunc
> version of them to trigger an enomem_panic in that case.
> 
> Fix this by passing along the NULL pointer unchanged.
> xstrdup() already behaves exactly this way.
> 
> [...]

Applied, thanks!

[1/2] xfuncs: return NULL from xstrdup_wchar(NULL)
      https://git.pengutronix.de/cgit/barebox/commit/?id=4cb8c6cd241b (link may not be stable)
[2/2] include: xfuncs: employ compiler attributes to aid GCC warnings
      https://git.pengutronix.de/cgit/barebox/commit/?id=86f784ae4e68 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer at pengutronix.de>




More information about the barebox mailing list