diff options
author | Daniel Jones <admin@danieljon.es> | 2020-05-13 23:53:38 +0930 |
---|---|---|
committer | Daniel Jones <admin@danieljon.es> | 2020-05-13 23:53:38 +0930 |
commit | 6d97cea4618b33d99f4c6022f4c628fccfd31160 (patch) | |
tree | 6a9d48b179ef7bfba3a37faa84affd34c7e6943a | |
parent | 7a92b2306bb70e1551217c77163ae06e84bfdd92 (diff) | |
download | websitegenerator-6d97cea4618b33d99f4c6022f4c628fccfd31160.tar.gz websitegenerator-6d97cea4618b33d99f4c6022f4c628fccfd31160.zip |
set girls used array to -1 every iteration
-rw-r--r-- | pages.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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]) { |