![leitner](/assets/img/avatar_default.png)
write generic stralloc and array textcode wrapper functions change textcode API to use long instead of int add cescape fmt and scan functions to textcode add fmt_foldwhitespace to textcode
17 lines
283 B
C
17 lines
283 B
C
#include "scan.h"
|
|
|
|
unsigned int scan_ip6_flat(const char *s,char ip[16])
|
|
{
|
|
int i;
|
|
for (i=0; i<16; i++) {
|
|
int tmp;
|
|
tmp=scan_fromhex(*s++);
|
|
if (tmp<0) return 0;
|
|
ip[i]=tmp << 4;
|
|
tmp=scan_fromhex(*s++);
|
|
if (tmp<0) return 0;
|
|
ip[i]+=tmp;
|
|
}
|
|
return 32;
|
|
}
|