Skip to content

Commit

Permalink
refactor: reduce varible scope to address scope warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharansrj567 committed Jan 13, 2024
1 parent 24c887f commit 8270ae4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/imagery/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ int I_get_subgroup_ref2(const char *group, const char *subgroup,
static int get_ref(const char *group, const char *subgroup, const char *gmapset,
struct Ref *ref)
{
int n;
char buf[1024];
char name[INAME_LEN], mapset[INAME_LEN];
char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
Expand All @@ -200,8 +199,8 @@ int n;
return 0;

while (G_getl2(buf, sizeof buf, fd)) {
n = sscanf(buf, "%255s %255s %15s", name, mapset,
color); /* better use INAME_LEN */
int n = sscanf(buf, "%255s %255s %15s", name, mapset,
color); /* better use INAME_LEN */
if (n == 2 || n == 3) {
I_add_file_to_group_ref(name, mapset, ref);
if (n == 3)
Expand Down

0 comments on commit 8270ae4

Please sign in to comment.