windows: Fix off-by-one error in strerror_s_extended()
authorTobias Brunner <tobias@strongswan.org>
Wed, 2 Jul 2014 09:59:01 +0000 (11:59 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 2 Jul 2014 10:38:45 +0000 (12:38 +0200)
src/libstrongswan/utils/windows.c

index d679684..8820287 100644 (file)
@@ -362,7 +362,7 @@ int strerror_s_extended(char *buf, size_t buflen, int errnum)
        };
        int offset = EADDRINUSE;
 
-       if (errnum < offset || errnum > offset + countof(errstr))
+       if (errnum < offset || errnum >= offset + countof(errstr))
        {
                return strerror_s(buf, buflen, errnum);
        }