File indexing completed on 2024-04-28 04:21:33

0001 /*
0002  *  SPDX-License-Identifier: BSD-3-Clause
0003  */
0004 
0005 #include <string.h>
0006 #include <zlib.h>
0007 
0008 int version[3] = {0, 0, 0};
0009 
0010 static void decode(char *str)
0011 {
0012     int n;
0013     for (n = 0; n < 3 && str; n++) {
0014         char *pnt = strchr(str, '.');
0015         if (pnt) {
0016             *pnt++ = '\0';
0017         }
0018         version[n] = atoi(str);
0019         str = pnt;
0020     }
0021 }
0022 
0023 int main(void)
0024 {
0025     decode(strdup(zlibVersion()));
0026     return
0027         (version[0] < 1 ||
0028          (version[0] == 1 &&
0029           (version[1] < 1 ||
0030            (version[1] == 1 && version[2] < 4))));
0031 }