Skip to content
This repository has been archived by the owner on Feb 19, 2023. It is now read-only.

Commit

Permalink
add const
Browse files Browse the repository at this point in the history
  • Loading branch information
CCXXXI committed Jan 10, 2021
1 parent e8baca1 commit 318359d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/userprog/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static bool is_valid_ptr(const void *ptr)
/* Returns true if [START, START + SIZE) is all valid. */
static bool is_user_mem(const void *start, size_t size)
{
for (void *ptr = start; ptr < start + size; ptr += PGSIZE)
for (const void *ptr = start; ptr < start + size; ptr += PGSIZE)
{
if (!is_valid_ptr(ptr))
return false;
Expand All @@ -168,7 +168,7 @@ static bool is_valid_str(const char *str)
if (!is_valid_ptr(str))
return false;

for (char *c = str; *c != '\0';)
for (const char *c = str; *c != '\0';)
{
++c;
if (c - str + 2 == PGSIZE || !is_valid_ptr(c))
Expand Down

0 comments on commit 318359d

Please sign in to comment.