summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jones <admin@danieljon.es>2020-05-13 23:53:38 +0930
committerDaniel Jones <admin@danieljon.es>2020-05-13 23:53:38 +0930
commit6d97cea4618b33d99f4c6022f4c628fccfd31160 (patch)
tree6a9d48b179ef7bfba3a37faa84affd34c7e6943a
parent7a92b2306bb70e1551217c77163ae06e84bfdd92 (diff)
downloadwebsitegenerator-6d97cea4618b33d99f4c6022f4c628fccfd31160.tar.gz
websitegenerator-6d97cea4618b33d99f4c6022f4c628fccfd31160.zip
set girls used array to -1 every iteration
-rw-r--r--pages.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pages.c b/pages.c
index 9e2a9c0..7f11b76 100644
--- a/pages.c
+++ b/pages.c
@@ -619,12 +619,13 @@ writeposts(const int *posts, size_t totalposts, const char *outfile, int current
{
char num[4] = {0}; /* will never have more than 999 posts */
int girl_variant = 0;
- int used[3] = {-1};
+ int used[3];
snprintf(num, 4, "%d", post);
num[3] = '\0';
fprintf(tmp, "\n<a href='direct/%d.html'>", post);
for (int i = 0; i < strlen(num); i++)
{
+ memset(used, -1, 3*sizeof(int));
girl_variant = rand() % 10;
while (girl_variant == used[0] || girl_variant == used[1] || girl_variant == used[2])
{