aboutsummaryrefslogtreecommitdiff
path: root/src/pattern_sim.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r--src/pattern_sim.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c
index 889d8e9d..bfc6be37 100644
--- a/src/pattern_sim.c
+++ b/src/pattern_sim.c
@@ -157,8 +157,9 @@ int main(int argc, char *argv[])
int config_nonoise = 0;
int config_nobloom = 0;
int config_nosfac = 0;
- int number = 1; /* Index for the current image */
- int n_images = 1; /* Generate one image by default */
+ int ndone = 0; /* Number of simulations done (images or not) */
+ int number = 1; /* Number used for filename of image */
+ int n_images = 1; /* Generate one image by default */
int done = 0;
/* Long options */
@@ -306,9 +307,9 @@ int main(int argc, char *argv[])
free(image.sfacs);
free(image.twotheta);
- number++;
+ ndone++;
- if ( n_images && (number > n_images) ) done = 1;
+ if ( n_images && (ndone > n_images) ) done = 1;
} while ( !done );