aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-05 15:44:04 +0100
committerThomas White <taw@physics.org>2010-02-05 15:44:04 +0100
commit32f0796c1906818edb1f7cbfe57c76290fd97d56 (patch)
tree0c7e92286e04008d5d5e4586532192a2529e2281
parent938bb822a1e8f203d891c2eff43044e881ec17f9 (diff)
Fix counting again
-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 );