Todd C. Miller
e43c964c43
Use sudo_mmap_alloc functions instead of private versions.
...
We no longer need to keep track of the allocation size.
2022-07-25 16:05:10 -06:00
Todd C. Miller
13672f28df
Make sudo pass -Wwrite-strings
2022-06-28 16:33:15 -06:00
Larkin Nickle
07bdfeedb8
Define MAP_FAILED where relevant if undefined
...
On systems such as HP-UX 10.20, MAP_FAILED is not
defined.
2021-10-21 19:16:28 -04:00
Todd C. Miller
03ad96e445
Use the fallthrough attribute instead of /* FALLTHROUGH */ comments.
2020-08-01 13:10:50 -06:00
Todd C. Miller
446ae3f507
Include string.h unconditionally and only use strings.h for strn?casecmp()
...
In the pre-POSIX days BSD had strings.h, not string.h.
Now strings.h is only used for non-ANSI string functions.
2020-05-18 07:59:24 -06:00
Todd C. Miller
dd88460800
We no longer need to include headers we don't use for sudo*.h files.
...
Previously we needed to include headers required by the various
sudo*h files. Now those files are more self-sufficient and we
should only include headers needed by code in the various .c files.
2020-05-18 06:47:04 -06:00
Todd C. Miller
1e1ef61902
Add SPDX-License-Identifier to files.
2019-04-29 07:21:51 -06:00
Todd C. Miller
48fba3c2cc
update my email to Todd.Miller@sudo.ws
2017-12-03 17:53:40 -07:00
Todd C. Miller
e014159fe8
Use EOVERFLOW, not ENOMEM for overflow conditions.
...
For snprintf() and vsnprintf(), POSIX says we should return -1 and
set errno to EOVERFLOW if the size param is > INT_MAX; also zero
out the string in this case (not mandated by POSIX) for safety.
2016-05-12 10:07:59 -06:00
Todd C. Miller
b756b6a112
Add missing fcntl.h include.
2015-06-30 10:32:42 -06:00
Todd C. Miller
4a07b472f0
Only include stddef.h where it is needed.
2015-06-20 05:34:35 -06:00
Todd C. Miller
dc883f2454
We require ANSI C so stop using the obsolete STDC_HEADERS.
2015-06-19 14:29:27 -06:00
Todd C. Miller
4f9cabd005
Remove obsolete memory.h include.
2015-06-18 21:02:57 -06:00
Todd C. Miller
a50555faa2
Remove support for the obsolete malloc.h header.
2015-06-18 20:30:59 -06:00
Todd C. Miller
9884df8c9e
If asprintf() or vasprintf() fail, set the dest pointer to NULL
...
like BSD and Solaris do. This appears to be the direction glibc
is going as well.
2015-06-03 11:07:56 -06:00
Todd C. Miller
cbcaaa299a
No need to cast malloc() return value.
2015-05-14 10:47:09 -06:00
Todd C. Miller
b5831d55d8
Update snprintf.c from OpenBSD. The floating point and wide character
...
code has been retained but is not compiled by default.
2015-02-21 16:52:14 -07:00
Todd C. Miller
47835ff289
Rename missing.h -> sudo_compat.h
2014-07-22 14:25:16 -06:00
Todd C. Miller
87c2fe5a31
Prefix all libc replacements with sudo_ and #define the real name
...
to the sudo_ version. That way we don't pollute the libc namespace.
2014-06-26 15:51:08 -06:00
Todd C. Miller
4d37a4a162
Top level directory reorg
...
Move src/po -> po
Combine common and compat -> lib/util
Move zlib -> lib/zlib
2014-06-26 15:51:02 -06:00