Skip to content

Commit e36b7aa

Browse files
AZero13millert
authored andcommitted
add restrict to a few more places
1 parent 916d6db commit e36b7aa

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

include/sudo_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ sudo_dso_public int sudo_secure_open_file_v1(const char *path, uid_t uid, gid_t
306306
#define sudo_secure_open_file(_a, _b, _c, _d, _e) sudo_secure_open_file_v1((_a), (_b), (_c), (_d), (_e))
307307
sudo_dso_public int sudo_secure_open_dir_v1(const char *path, uid_t uid, gid_t gid, struct stat *sb, int *error);
308308
#define sudo_secure_open_dir(_a, _b, _c, _d, _e) sudo_secure_open_dir_v1((_a), (_b), (_c), (_d), (_e))
309-
sudo_dso_public int sudo_open_conf_path_v1(const char *path, char *name, size_t namesize, int (*fn)(const char *, int));
309+
sudo_dso_public int sudo_open_conf_path_v1(const char *restrict path, char *restrict name, size_t namesize, int (*fn)(const char *, int));
310310
#define sudo_open_conf_path(_a, _b, _c, _d) sudo_open_conf_path_v1((_a), (_b), (_c), (_d))
311311

312312
/* setgroups.c */

lib/util/secure_path.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ sudo_secure_open_dir_v1(const char *path, uid_t uid, gid_t gid,
165165
* Sets name based on the last file it tried to open, even on error.
166166
*/
167167
int
168-
sudo_open_conf_path_v1(const char *path, char *name, size_t namesize,
168+
sudo_open_conf_path_v1(const char *restrict path, char *restrict name, size_t namesize,
169169
int (*fn)(const char *, int))
170170
{
171171
const char *cp, *ep, *path_end;

lib/util/uuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ sudo_uuid_to_string_v1(const unsigned char uuid[restrict static 16], char * rest
100100
* Returns 0 on success, -1 if str is not a valid uuid.
101101
*/
102102
int
103-
sudo_uuid_from_string_v1(const char *str, unsigned char uuid[static 16])
103+
sudo_uuid_from_string_v1(const char *str, unsigned char uuid[restrict static 16])
104104
{
105105
unsigned int i = 0, j = 0;
106106
int ch;

plugins/sudoers/toke_util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static size_t arg_size = 0;
4040
* Requires that dst have at least len + 1 bytes free.
4141
*/
4242
static void
43-
copy_string(char *dst, const char *src, size_t len)
43+
copy_string(char * restrict dst, const char * restrict src, size_t len)
4444
{
4545
const char *end = src + len;
4646
debug_decl(copy_string, SUDOERS_DEBUG_PARSER);

0 commit comments

Comments
 (0)