You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
541 B
25 lines
541 B
4 years ago
|
#include <string.h>
|
||
|
#include <zlib.h>
|
||
|
|
||
|
int version[3] = {0,0,0};
|
||
|
|
||
|
static void decode(char *str)
|
||
|
{
|
||
|
int n;
|
||
|
for (n = 0; n < 3 && str; n++) {
|
||
|
char *pnt = strchr(str, '.');
|
||
|
if (pnt) *pnt++ = '\0';
|
||
|
version[n] = atoi(str);
|
||
|
str = pnt;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
int main(void) {
|
||
|
decode(strdup(zlibVersion()));
|
||
|
return
|
||
|
(version[0] < 1 ||
|
||
|
(version[0] == 1 &&
|
||
|
(version[1] < 1 ||
|
||
|
(version[1] == 1 && version[2] < 4))));
|
||
|
}
|