Fix sloppy wording around stricly less-than vs less or equal
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/include/mbedtls/net_sockets.h b/include/mbedtls/net_sockets.h
index 310b397..702e93f 100644
--- a/include/mbedtls/net_sockets.h
+++ b/include/mbedtls/net_sockets.h
@@ -157,7 +157,7 @@
*
* \note The current implementation of this function uses
* select() and returns an error if the file descriptor
- * is beyond \c FD_SETSIZE.
+ * is \c FD_SETSIZE or greater.
*
* \param ctx Socket to check
* \param rw Bitflag composed of MBEDTLS_NET_POLL_READ and
@@ -242,7 +242,7 @@
*
* \note The current implementation of this function uses
* select() and returns an error if the file descriptor
- * is beyond \c FD_SETSIZE.
+ * is \c FD_SETSIZE or greater.
*
* \param ctx Socket
* \param buf The buffer to write to
diff --git a/library/net_sockets.c b/library/net_sockets.c
index 375434a..ad1ac13 100644
--- a/library/net_sockets.c
+++ b/library/net_sockets.c
@@ -466,9 +466,9 @@
return( MBEDTLS_ERR_NET_INVALID_CONTEXT );
/* A limitation of select() is that it only works with file descriptors
- * up to FD_SETSIZE. This is a limitation of the fd_set type. Error out
- * early, because attempting to call FD_SET on a large file descriptor
- * is a buffer overflow on typical platforms. */
+ * that are strictly less than FD_SETSIZE. This is a limitation of the
+ * fd_set type. Error out early, because attempting to call FD_SET on a
+ * large file descriptor is a buffer overflow on typical platforms. */
if( fd >= FD_SETSIZE )
return( MBEDTLS_ERR_NET_POLL_FAILED );
@@ -592,9 +592,9 @@
return( MBEDTLS_ERR_NET_INVALID_CONTEXT );
/* A limitation of select() is that it only works with file descriptors
- * up to FD_SETSIZE. This is a limitation of the fd_set type. Error out
- * early, because attempting to call FD_SET on a large file descriptor
- * is a buffer overflow on typical platforms. */
+ * that are strictly less than FD_SETSIZE. This is a limitation of the
+ * fd_set type. Error out early, because attempting to call FD_SET on a
+ * large file descriptor is a buffer overflow on typical platforms. */
if( fd >= FD_SETSIZE )
return( MBEDTLS_ERR_NET_POLL_FAILED );