Skip to content

Commit

Permalink
refactor: change PATH_MAX to sizeof(path)
Browse files Browse the repository at this point in the history
Signed-off-by: Rentib <[email protected]>
  • Loading branch information
Rentib committed Oct 19, 2024
1 parent fdb7903 commit cae1bbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/image.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ static bool get_image_thumb_path(struct image* image, char* path)
cache_dir = strcat(cache_dir, "/.swayimg");
}
}
r = snprintf(path, PATH_MAX, "%s%s", cache_dir, image->source);
return r >= 0 && r < PATH_MAX;
r = snprintf(path, (size_t)sizeof(path), "%s%s", cache_dir, image->source);
return r >= 0 && r < (int)sizeof(path);
}

// TODO: where should this function be?
Expand Down

0 comments on commit cae1bbd

Please sign in to comment.