2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00

Add restrict to strlcpy and expand_prompt

This commit is contained in:
Rose 2023-10-16 20:53:22 -04:00 committed by Todd C. Miller
parent fabb6264fc
commit 97f8052427
3 changed files with 5 additions and 5 deletions

View File

@ -40,8 +40,8 @@
* the dynamically allocated result.
*/
char *
expand_prompt(const struct sudoers_context *ctx, const char *old_prompt,
const char *auth_user)
expand_prompt(const struct sudoers_context *ctx,
const char *restrict old_prompt, const char *restrict auth_user)
{
size_t len, n;
int subst;

View File

@ -33,7 +33,7 @@
* Like strlcpy() but collapses non-space chars escaped with a backslash.
*/
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;
char ch;

View File

@ -333,7 +333,7 @@ int check_user_runchroot(const char *runchroot);
int check_user_runcwd(const char *runcwd);
/* 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 */
bool sudo_auth_needs_end_session(void);
@ -494,7 +494,7 @@ void canon_path_free(char *resolved);
void canon_path_free_cache(void);
/* 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 */
char *strvec_join(char *const argv[], char sep, size_t (*cpy)(char *, const char *, size_t));