31 char * major_ptr = this->version + 5;
32 char * minor_ptr = strchr(major_ptr,
'.') + 1;
33 char version[] =
"\0\0\0";
35 if (NULL == minor_ptr ||
36 ((minor_ptr - major_ptr - 1) > 2) ||
37 strlen(minor_ptr) > 2)
40 memcpy(version, major_ptr, minor_ptr - major_ptr - 1);
41 *major = atoi(version);
43 memset(version, 0, 3);
44 strcpy(version, minor_ptr);
45 *minor = atoi(version);
47 return ((*major)<<7)|(*minor);
int httpMessageGetVersion(HttpMessage this, int *major, int *minor)