From ec6bdd1ae9b2b237332860fa0caeb10de7c9b866 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 20 Jul 2018 11:43:41 +0100 Subject: Use arc4random_buf() instead of random() when available. --- make/test/arc4random_buf.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 make/test/arc4random_buf.cpp (limited to 'make/test') diff --git a/make/test/arc4random_buf.cpp b/make/test/arc4random_buf.cpp new file mode 100644 index 000000000..86f74f624 --- /dev/null +++ b/make/test/arc4random_buf.cpp @@ -0,0 +1,26 @@ +/* + * InspIRCd -- Internet Relay Chat Daemon + * + * Copyright (C) 2018 Peter Powell + * + * This file is part of InspIRCd. InspIRCd is free software: you can + * redistribute it and/or modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +#include + +int main() { + char buffer[100]; + arc4random_buf(buffer, sizeof(buffer)); + return 0; +} -- cgit v1.2.3