Fix: make use of whole char length instead of fixed
Christian Immanuel · 2024-03-16 08:54 · a4ee86e2d29a45d059485a4efd724af4d2b9f152
inout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inout.c b/inout.c
index c2c0b03..c7d71b5 100644
--- a/inout.c
+++ b/inout.c
@@ -27,7 +27,7 @@ void getLine(wchar_t* line, wchar_t* chars, int length, int wc){
word_length = rand() % 6 + 4;
continue;
}
- int ran = rand() % 4 + 0;
+ int ran = rand() % (wcslen(chars));
line[i] = chars[ran];
}
line[i] = L'\0';