From 872052b5b2056f26557e091368b1beaa64d88cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Wed, 26 Jun 2024 22:01:29 +0200 Subject: [PATCH] Avoid magic numbers for generating timeout code --- src/game/client/gameclient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 1614252db..2e52b3d29 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -209,9 +209,9 @@ static void GenerateTimeoutCode(char *pTimeoutCode) for(unsigned int i = 0; i < 16; i++) { if(rand() % 2) - pTimeoutCode[i] = (char)((rand() % 26) + 97); + pTimeoutCode[i] = (char)((rand() % ('z' - 'a' + 1)) + 'a'); else - pTimeoutCode[i] = (char)((rand() % 26) + 65); + pTimeoutCode[i] = (char)((rand() % ('Z' - 'A' + 1)) + 'A'); } } }