New module 'strsignal'.
[gnulib.git] / lib / getndelim2.c
index 453fd38..e1cd40a 100644 (file)
@@ -4,10 +4,10 @@
    Copyright (C) 1993, 1996, 1997, 1998, 2000, 2003, 2004, 2006 Free
    Software Foundation, Inc.
 
-   This program is free software; you can redistribute it and/or modify
+   This program 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 2, or (at your option)
-   any later version.
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,8 +15,7 @@
    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, write to the Free Software Foundation,
-   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Originally written by Jan Brittenson, bson@gnu.ai.mit.edu.  */
 
@@ -34,9 +33,8 @@
 #include <limits.h>
 #include <stdint.h>
 
-/* Mingw doesn't have SSIZE_MAX.  */
 #ifndef SSIZE_MAX
-# define SSIZE_MAX ((((ssize_t)1 << (sizeof (ssize_t) * CHAR_BIT - 2)) - 1) * 2 + 1)
+# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
 #endif
 
 /* The maximum value that getndelim2 can return without suffering from