* [BUG] ELL doesn't have a fallback for rawmemchr
@ 2020-11-30 16:49 =?unknown-8bit?q?=C3=89rico?= Nogueira
2020-11-30 19:05 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: =?unknown-8bit?q?=C3=89rico?= Nogueira @ 2020-11-30 16:49 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 953 bytes --]
Hi!
Building ELL 0.35 on a musl system fails, due to ell/pem.c using
rawmemchr(), which is a glibc extension. Building IWD with internal
ELL fails for the same reason.
I see that IWD itself has src/missing.h with a fallback, but ELL lacks
that.
We are using the following patch to fix the build:
diff --git a/ell/pem.c b/ell/pem.c
index 790f2c2..237ae02 100644
--- a/ell/pem.c
+++ b/ell/pem.c
@@ -224,7 +224,7 @@ static uint8_t *pem_load_buffer(const void *buf, size_t=
buf_len,
=20
/* Check that each header line has a key and a colon */
while (start < end) {
- const char *lf =3D rawmemchr(start, '\n');
+ const char *lf =3D memchr(start, '\n', end - start);
const char *colon =3D memchr(start, ':', lf - start);
=20
if (!colon)
--
If ELL is willing to include a src/missing.h of their own, that would
solve the issue, but avoiding rawmemchr() completely is also a
possibility.
Thanks,
Érico
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [BUG] ELL doesn't have a fallback for rawmemchr
2020-11-30 16:49 [BUG] ELL doesn't have a fallback for rawmemchr =?unknown-8bit?q?=C3=89rico?= Nogueira
@ 2020-11-30 19:05 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2020-11-30 19:05 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
Hi Érico,
On 11/30/20 10:49 AM, Érico Nogueira wrote:
> Hi!
>
> Building ELL 0.35 on a musl system fails, due to ell/pem.c using
> rawmemchr(), which is a glibc extension. Building IWD with internal
> ELL fails for the same reason.
Thanks for reporting this.
>
> I see that IWD itself has src/missing.h with a fallback, but ELL lacks
> that.
I ported the rawmemchr bits in missing.h from iwd to ell in commit
3916c1cc32be205e185a8a56de5cde1b9ec60e81.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-30 19:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-30 16:49 [BUG] ELL doesn't have a fallback for rawmemchr =?unknown-8bit?q?=C3=89rico?= Nogueira
2020-11-30 19:05 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.