diff options
| author | 2011-12-16 17:35:00 +0000 | |
|---|---|---|
| committer | 2011-12-16 17:35:00 +0000 | |
| commit | 9f0761fdb8f2bee5fae9128f89da5f553c3a67c7 (patch) | |
| tree | 7faca374777e7a03a23321833739e76ee08fb90c | |
| parent | -H is an extension to posix; (diff) | |
| download | wireguard-openbsd-9f0761fdb8f2bee5fae9128f89da5f553c3a67c7.tar.xz wireguard-openbsd-9f0761fdb8f2bee5fae9128f89da5f553c3a67c7.zip | |
simplify
ok chl@ gilles@
| -rw-r--r-- | usr.sbin/smtpd/queue_backend.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.sbin/smtpd/queue_backend.c b/usr.sbin/smtpd/queue_backend.c index 7c5dd7e3ef0..45a3ff56b0c 100644 --- a/usr.sbin/smtpd/queue_backend.c +++ b/usr.sbin/smtpd/queue_backend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue_backend.c,v 1.15 2011/12/14 17:55:55 eric Exp $ */ +/* $OpenBSD: queue_backend.c,v 1.16 2011/12/16 17:35:00 eric Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@openbsd.org> @@ -149,10 +149,8 @@ queue_generate_msgid(void) { u_int32_t msgid; -again: - msgid = arc4random_uniform(0xffffffff); - if (msgid == 0) - goto again; + while((msgid = arc4random_uniform(0xffffffff)) == 0) + ; return msgid; } @@ -163,10 +161,8 @@ queue_generate_evpid(u_int32_t msgid) u_int32_t rnd; u_int64_t evpid; -again: - rnd = arc4random_uniform(0xffffffff); - if (rnd == 0) - goto again; + while((rnd = arc4random_uniform(0xffffffff)) == 0) + ; evpid = msgid; evpid <<= 32; |
