Skip to content

Commit e7483ae

Browse files
LumioseSilmillert
authored andcommitted
Restrict-qualify stat_multiarch
1 parent 7269ee2 commit e7483ae

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

include/sudo_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ sudo_dso_public int sudo_mmap_protect_v1(void *ptr);
242242
#define sudo_mmap_protect(_a) sudo_mmap_protect_v1(_a)
243243

244244
/* multiarch.c */
245-
sudo_dso_public char *sudo_stat_multiarch_v1(const char *path, struct stat *sb);
245+
sudo_dso_public char *sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb);
246246
#define sudo_stat_multiarch(_a, _b) sudo_stat_multiarch_v1((_a), (_b))
247247

248248
/* parseln.c */

lib/util/multiarch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* Returns a dynamically allocated string on success and NULL on failure.
4545
*/
4646
char *
47-
sudo_stat_multiarch_v1(const char *path, struct stat *sb)
47+
sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb)
4848
{
4949
# if defined(__ILP32__)
5050
const char *libdirs[] = { "/libx32/", "/lib/", "/libexec/", NULL };
@@ -96,7 +96,7 @@ sudo_stat_multiarch_v1(const char *path, struct stat *sb)
9696
}
9797
#else
9898
char *
99-
sudo_stat_multiarch_v1(const char *path, struct stat *sb)
99+
sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb)
100100
{
101101
return NULL;
102102
}

0 commit comments

Comments
 (0)