From: Andre Noll Date: Sun, 10 Jul 2016 14:43:02 +0000 (+0200) Subject: gcrypt: Simplify init_random_seed_or_die(). X-Git-Tag: v0.6.0~13^2 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=1bec000ff43c20d8c2f904678d1845ee65b4ba18;p=paraslash.git gcrypt: Simplify init_random_seed_or_die(). Trivial equivalent transformation which gets rid of a local variable and one level of indentation. --- diff --git a/gcrypt.c b/gcrypt.c index 7d6b2cae..5202c9b7 100644 --- a/gcrypt.c +++ b/gcrypt.c @@ -64,15 +64,13 @@ void get_random_bytes_or_die(unsigned char *buf, int num) */ void init_random_seed_or_die(void) { - const char *ver, *req_ver; - - ver = gcry_check_version(NULL); - req_ver = "1.5.0"; - if (!gcry_check_version(req_ver)) { - PARA_EMERG_LOG("fatal: need at least libgcrypt-%s, have: %s\n", - req_ver, ver); - exit(EXIT_FAILURE); - } + const char *req_ver = "1.5.0"; + + if (gcry_check_version(req_ver)) + return; + PARA_EMERG_LOG("fatal: need at least libgcrypt-%s, have: %s\n", + req_ver, gcry_check_version(NULL)); + exit(EXIT_FAILURE); } /** S-expression for the public part of an RSA key. */