From 5c0f08087429e7a89c97742e4a4b146688442a04 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 11 Dec 2019 05:12:36 -0800 Subject: Address complaints found by lgtm.com. --- src/platform/posix/posix_udp.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'src/platform/posix/posix_udp.c') diff --git a/src/platform/posix/posix_udp.c b/src/platform/posix/posix_udp.c index 6b1ef399..015fb4ad 100644 --- a/src/platform/posix/posix_udp.c +++ b/src/platform/posix/posix_udp.c @@ -1,5 +1,5 @@ // -// Copyright 2018 Staysail Systems, Inc. +// Copyright 2019 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a @@ -23,9 +23,6 @@ #include #include #include -#ifdef NNG_HAVE_ALLOCA -#include -#endif // UDP support. @@ -123,26 +120,14 @@ nni_posix_udp_dosend(nni_plat_udp *udp) if (len < 1) { rv = NNG_EADDRINVAL; } else { - unsigned niov; - nni_iov *aiov; -#ifdef NNG_HAVE_ALLOCA - struct iovec *iov; -#else + unsigned niov; + nni_iov * aiov; struct iovec iov[16]; -#endif nni_aio_get_iov(aio, &niov, &aiov); -#ifdef NNG_HAVE_ALLOCA - if (niov > 64) { - rv = NNG_EINVAL; - } else { - iov = alloca(niov * sizeof(*iov)); - } -#else if (niov > NNI_NUM_ELEMENTS(iov)) { rv = NNG_EINVAL; } -#endif if (rv == 0) { struct msghdr hdr = { .msg_name = NULL }; for (unsigned i = 0; i < niov; i++) { -- cgit v1.2.3-70-g09d2