- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
static long get_ver(unsigned short *src, unsigned char *dst)
{
u8 tmp_buf[16];
s32 i = 0;
while(1)
{
if(dst[i] < '0' || dst[i] > '9')
break;
tmp_buf[i] = dst[i] % 0x30;
i++;
}
if(i == 1)
*src = tmp_buf[0];
else if(i == 2)
*src = (tmp_buf[0] * 10) + tmp_buf[1];
else if(i == 3)
*src = (tmp_buf[0] * 100) + (tmp_buf[1] * 10) + tmp_buf[2];
else if(i == 4)
*src = (tmp_buf[0] * 1000) + (tmp_buf[1] * 100) + (tmp_buf[2] * 10) + tmp_buf[3];
return i;
}