diff --git a/mtproto-utils.c b/mtproto-utils.c index 0948bc85..4f67a651 100644 --- a/mtproto-utils.c +++ b/mtproto-utils.c @@ -6,7 +6,13 @@ #include "mtproto-utils.h" static unsigned long long gcd (unsigned long long a, unsigned long long b) { - return b ? gcd (b, a % b) : a; + unsigned long long c; + while (b) { + c = a % b; + a = b; + b = c; + } + return a; } static int check_prime (struct tgl_state *TLS, TGLC_bn *p) {