@@ -204,10 +204,9 @@ int main(int argc, char *argv[])
204
204
outbandmax [i ] = (CELL )0 ;
205
205
outbandmin [i ] = (CELL )0 ;
206
206
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 );
209
208
210
- snprintf (tempname , sizeof (tempname ), "%s.%d" , out_opt -> answer , i );
209
+ snprintf (tempname , sizeof (tempname ), "%s.%d" , out_opt -> answer , i + 1 );
211
210
outfds [i ] = Rast_open_c_new (tempname );
212
211
}
213
212
@@ -226,11 +225,11 @@ int main(int argc, char *argv[])
226
225
if (outbandmin [i ] < (CELL )0 || outbandmax [i ] > (CELL )255 ) {
227
226
G_warning (_ ("The output cell map <%s.%d> has values "
228
227
"outside the 0-255 range." ),
229
- out_opt -> answer , i + 1 );
228
+ out_opt -> answer , i + 1 );
230
229
}
231
230
232
231
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 );
234
233
235
234
/* write a color table */
236
235
Rast_write_colors (tempname , G_mapset (), & color_tbl );
0 commit comments