Skip to content

Commit

Permalink
d.labels: Reduce scope of minreg and maxreg variables in main.c (#3979)
Browse files Browse the repository at this point in the history
Reduce scope of minreg and maxreg variables in d.labels/main.c

Co-authored-by: Shubham Vasudeo Desai <sdesai8@vclvm178-253.vcl.ncsu.edu>
  • Loading branch information
ShubhamDesai and Shubham Vasudeo Desai committed Jul 3, 2024
1 parent cc75269 commit 56eaf9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions display/d.labels/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main(int argc, char **argv)
struct Cell_head window;
char *label_name;
const char *mapset;
double minreg, maxreg, reg, dx, dy;
double reg, dx, dy;
FILE *infile;
struct Option *opt1;
struct Option *maxreg_opt, *minreg_opt;
Expand Down Expand Up @@ -91,7 +91,7 @@ int main(int argc, char **argv)
dy = window.north - window.south;
reg = sqrt(dx * dx + dy * dy);
if (minreg_opt->answer) {
minreg = atof(minreg_opt->answer);
double minreg = atof(minreg_opt->answer);
if (reg < minreg) {
G_warning(
_("Region size is lower than minreg, nothing displayed."));
Expand All @@ -100,7 +100,7 @@ int main(int argc, char **argv)
}
}
if (maxreg_opt->answer) {
maxreg = atof(maxreg_opt->answer);
double maxreg = atof(maxreg_opt->answer);
if (reg > maxreg) {
G_warning(
_("Region size is greater than maxreg, nothing displayed."));
Expand Down

0 comments on commit 56eaf9e

Please sign in to comment.