X-Git-Url: https://git.exim.org/users/jgh/exim.git/blobdiff_plain/b4161d10ee4c4eb7fd61224d827cc89726e2d8f8..d8129d876786c938f06dfbe91e51ebe36f09ae43:/test/src/fakens.c?ds=sidebyside diff --git a/test/src/fakens.c b/test/src/fakens.c index 912f41984..fd3604a3c 100644 --- a/test/src/fakens.c +++ b/test/src/fakens.c @@ -194,6 +194,19 @@ while (*name != 0) return pk; } +uschar * +bytefield(uschar ** pp, uschar * pk) +{ +unsigned value = 0; +uschar * p = *pp; + +while (isdigit(*p)) value = value*10 + *p++ - '0'; +while (isspace(*p)) p++; +*pp = p; +*pk++ = value & 255; +return pk; +} + uschar * shortfield(uschar ** pp, uschar * pk) { @@ -420,9 +433,9 @@ while (fgets(CS buffer, sizeof(buffer), f) != NULL) break; case ns_t_tlsa: - pk = shortfield(&p, pk); /* usage */ - pk = shortfield(&p, pk); /* selector */ - pk = shortfield(&p, pk); /* match type */ + pk = bytefield(&p, pk); /* usage */ + pk = bytefield(&p, pk); /* selector */ + pk = bytefield(&p, pk); /* match type */ while (isxdigit(*p)) { value = toupper(*p) - (isdigit(*p) ? '0' : '7') << 4;