mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
Add restrict to strlcpy and expand_prompt
This commit is contained in:
@@ -40,8 +40,8 @@
|
|||||||
* the dynamically allocated result.
|
* the dynamically allocated result.
|
||||||
*/
|
*/
|
||||||
char *
|
char *
|
||||||
expand_prompt(const struct sudoers_context *ctx, const char *old_prompt,
|
expand_prompt(const struct sudoers_context *ctx,
|
||||||
const char *auth_user)
|
const char *restrict old_prompt, const char *restrict auth_user)
|
||||||
{
|
{
|
||||||
size_t len, n;
|
size_t len, n;
|
||||||
int subst;
|
int subst;
|
||||||
|
@@ -33,7 +33,7 @@
|
|||||||
* Like strlcpy() but collapses non-space chars escaped with a backslash.
|
* Like strlcpy() but collapses non-space chars escaped with a backslash.
|
||||||
*/
|
*/
|
||||||
size_t
|
size_t
|
||||||
strlcpy_unescape(char *dst, const char *src, size_t size)
|
strlcpy_unescape(char *restrict dst, const char *restrict src, size_t size)
|
||||||
{
|
{
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
char ch;
|
char ch;
|
||||||
|
@@ -333,7 +333,7 @@ int check_user_runchroot(const char *runchroot);
|
|||||||
int check_user_runcwd(const char *runcwd);
|
int check_user_runcwd(const char *runcwd);
|
||||||
|
|
||||||
/* prompt.c */
|
/* prompt.c */
|
||||||
char *expand_prompt(const struct sudoers_context *ctx, const char *old_prompt, const char *auth_user);
|
char *expand_prompt(const struct sudoers_context *ctx, const char *restrict old_prompt, const char *restrict auth_user);
|
||||||
|
|
||||||
/* sudo_auth.c */
|
/* sudo_auth.c */
|
||||||
bool sudo_auth_needs_end_session(void);
|
bool sudo_auth_needs_end_session(void);
|
||||||
@@ -494,7 +494,7 @@ void canon_path_free(char *resolved);
|
|||||||
void canon_path_free_cache(void);
|
void canon_path_free_cache(void);
|
||||||
|
|
||||||
/* strlcpy_unesc.c */
|
/* strlcpy_unesc.c */
|
||||||
size_t strlcpy_unescape(char *dst, const char *src, size_t size);
|
size_t strlcpy_unescape(char *restrict dst, const char *restrict src, size_t size);
|
||||||
|
|
||||||
/* strvec_join.c */
|
/* strvec_join.c */
|
||||||
char *strvec_join(char *const argv[], char sep, size_t (*cpy)(char *, const char *, size_t));
|
char *strvec_join(char *const argv[], char sep, size_t (*cpy)(char *, const char *, size_t));
|
||||||
|
Reference in New Issue
Block a user