Home | History | Annotate | Download | only in libwrap
History log of /src/lib/libwrap/expandm.c
RevisionDateAuthorComments
 1.13  04-Oct-2024  rillig libwrap: fix lint warning about "effectively discards 'const'"

lib/libwrap/expandm.c(57): warning: call to 'strstr' effectively
discards 'const' from argument [346]

No binary change.
 1.12  24-Jan-2019  mrg branches: 1.12.2; 1.12.14;
remove the new check for tlen >= PTRDIFF_MAX. the prior
checks assure the condition is met and GCC7 is happy.

suggested by kre.
 1.11  23-Jan-2019  kre And as long as we're attempting to achieve perfection in code
that is never going to be executed, let's also check for possible
overflow in a sum that will never be computed...
 1.10  23-Jan-2019  kre There's no point setting errno, it is just overwritten by err
in the exit path ... this function never fails, it simply sometimes
doesn't actually expand the %m and just leaves the format string
intact.

And declare variables at the head of their scope, not at some random
place in the middle of the code, whatever C allows, that is just ugly.
 1.9  23-Jan-2019  christos limit allocation to PTRDIFF_T to appease gcc-7, from mrg@
 1.8  14-Jan-2019  kre branches: 1.8.2;

Whitespace (indent with tabs, rather than spaces), and rearrange one
line that needed wrapping so it no longer does, and is (IMO) clearer.
WHile here, note that this was created in 2019, not 2018, for the
copyright notice...

NFCI.
 1.7  13-Jan-2019  kre Always return from expandm() with errno unaltered, so on the
off chance it failed, there's still the possibility that whatever
processes the result will be able to deal with the %m that would
(presumably) be left in the format string.

And as a frill, don't call strerror() until we know we are
going to use its result (still call it only once, no matter
how many %m's are in the format string).
 1.6  13-Jan-2019  christos check for *. integer overflow over ptrdiff. Pointed out by kre@
 1.5  12-Jan-2019  kre Make expandm() return a const char * so we can do away with __UNCONST()
and more importantly, so that we don't accidentally return a value
that is a const char * in reality (pointer to read only string) as a
char *.
 1.4  12-Jan-2019  christos Don't do %%m -> %%%m escaping, requested by gson@.
 1.3  12-Jan-2019  kre Return the buffer that has not been freed, so it can be later,
rather than the one that already was.
 1.2  12-Jan-2019  christos Provide an extra argument to store the returned pointer so we can use
the function directly as the return format (before assigning it to a
variable) to appease clang.
 1.1  11-Jan-2019  christos Use a utility function to expand %m correctly...
 1.8.2.3  26-Jan-2019  pgoyette Sync with HEAD
 1.8.2.2  18-Jan-2019  pgoyette Synch with HEAD
 1.8.2.1  14-Jan-2019  pgoyette file expandm.c was added on branch pgoyette-compat on 2019-01-18 08:50:11 +0000
 1.12.14.1  02-Aug-2025  perseant Sync with HEAD
 1.12.2.2  10-Jun-2019  christos Sync with HEAD
 1.12.2.1  24-Jan-2019  christos file expandm.c was added on branch phil-wifi on 2019-06-10 22:05:28 +0000

RSS XML Feed