X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=random.c;h=2680827aba7a995930fe53d4dccbd71ce1f8bd18;hb=d8a024fe35f4be56f4ac17fa68aee2264960a8ac;hp=111f16ec787ddae5d347fd7f54be6462831ba378;hpb=4f5e39ecfaa49376b0a5c3a4c384e91a828c1105;p=secnet.git diff --git a/random.c b/random.c index 111f16e..2680827 100644 --- a/random.c +++ b/random.c @@ -1,3 +1,22 @@ +/* + * This file is part of secnet. + * See README for full list of copyright holders. + * + * secnet 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; either version d of the License, or + * (at your option) any later version. + * + * secnet 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 + * version 3 along with secnet; if not, see + * https://www.gnu.org/licenses/gpl.html. + */ + #include "secnet.h" #include #include @@ -14,7 +33,7 @@ struct rgen_data { }; static random_fn random_generate; -static bool_t random_generate(void *data, uint32_t bytes, uint8_t *buff) +static bool_t random_generate(void *data, int32_t bytes, uint8_t *buff) { struct rgen_data *st=data; int r; @@ -51,7 +70,7 @@ static list_t *random_apply(closure_t *self, struct cloc loc, item_t *arg1, *arg2; string_t filename=NULL; - st=safe_malloc(sizeof(*st),"random_apply"); + NEW(st); st->cl.description="randomsource"; st->cl.type=CL_RANDOMSRC;