Skip to content

Commit cba5d2a

Browse files
LumioseSilmillert
authored andcommitted
Use static declaration for array sizes to uuid functions
1 parent 6f8dfd9 commit cba5d2a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

include/sudo_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ sudo_dso_public void sudo_get_ttysize_v2(int fd, int *rowp, int *colp);
350350
#define sudo_get_ttysize(_a, _b, _c) sudo_get_ttysize_v2((_a), (_b), (_c))
351351

352352
/* uuid.c */
353-
sudo_dso_public void sudo_uuid_create_v1(unsigned char uuid_out[16]);
353+
sudo_dso_public void sudo_uuid_create_v1(unsigned char uuid_out[restrict static 16]);
354354
#define sudo_uuid_create(_a) sudo_uuid_create_v1((_a))
355-
sudo_dso_public char *sudo_uuid_to_string_v1(const unsigned char uuid[restrict 16], char * restrict dst, size_t dstsiz);
355+
sudo_dso_public char *sudo_uuid_to_string_v1(const unsigned char uuid[restrict static 16], char * restrict dst, size_t dstsiz);
356356
#define sudo_uuid_to_string(_a, _b, _c) sudo_uuid_to_string_v1((_a), (_b), (_c))
357357

358358
#endif /* SUDO_UTIL_H */

lib/util/uuid.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct uuid {
5050
* As per RFC 4122 section 4.4.
5151
*/
5252
void
53-
sudo_uuid_create_v1(unsigned char uuid_out[16])
53+
sudo_uuid_create_v1(unsigned char uuid_out[restrict static 16])
5454
{
5555
struct uuid uuid;
5656

@@ -71,7 +71,7 @@ sudo_uuid_create_v1(unsigned char uuid_out[16])
7171
* Format a uuid as a 36-byte string (plus one for the NUL).
7272
*/
7373
char *
74-
sudo_uuid_to_string_v1(const unsigned char uuid[restrict 16], char * restrict dst, size_t dstsiz)
74+
sudo_uuid_to_string_v1(const unsigned char uuid[restrict static 16], char * restrict dst, size_t dstsiz)
7575
{
7676
const char hex[] = "0123456789abcdef";
7777
char *cp = dst;

0 commit comments

Comments
 (0)