Skip to content

Commit 902e95f

Browse files
fix missed index
1 parent d8b059f commit 902e95f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

imagery/i.cca/main.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,9 @@ int main(int argc, char *argv[])
204204
outbandmax[i] = (CELL)0;
205205
outbandmin[i] = (CELL)0;
206206

207-
datafds[i] =
208-
Rast_open_old(refs.file[i].name, refs.file[i].mapset);
207+
datafds[i] = Rast_open_old(refs.file[i].name, refs.file[i].mapset);
209208

210-
snprintf(tempname, sizeof(tempname), "%s.%d", out_opt->answer, i);
209+
snprintf(tempname, sizeof(tempname), "%s.%d", out_opt->answer, i + 1);
211210
outfds[i] = Rast_open_c_new(tempname);
212211
}
213212

@@ -226,11 +225,11 @@ int main(int argc, char *argv[])
226225
if (outbandmin[i] < (CELL)0 || outbandmax[i] > (CELL)255) {
227226
G_warning(_("The output cell map <%s.%d> has values "
228227
"outside the 0-255 range."),
229-
out_opt->answer, i+1);
228+
out_opt->answer, i + 1);
230229
}
231230

232231
Rast_make_grey_scale_colors(&color_tbl, 0, outbandmax[i]);
233-
snprintf(tempname, sizeof(tempname), "%s.%d", out_opt->answer, i+1);
232+
snprintf(tempname, sizeof(tempname), "%s.%d", out_opt->answer, i + 1);
234233

235234
/* write a color table */
236235
Rast_write_colors(tempname, G_mapset(), &color_tbl);

0 commit comments

Comments
 (0)