git://git.exim.org
/
users
/
jgh
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update DANE draft docs
[users/jgh/exim.git]
/
test
/
src
/
fakens.c
diff --git
a/test/src/fakens.c
b/test/src/fakens.c
index 912f41984d1da3c91f342a0004e44e3f5ad206b5..fd3604a3c6c5e2e50617db08b1178a536066fce2 100644
(file)
--- a/
test/src/fakens.c
+++ b/
test/src/fakens.c
@@
-194,6
+194,19
@@
while (*name != 0)
return pk;
}
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)
{
uschar *
shortfield(uschar ** pp, uschar * pk)
{
@@
-420,9
+433,9
@@
while (fgets(CS buffer, sizeof(buffer), f) != NULL)
break;
case ns_t_tlsa:
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;
while (isxdigit(*p))
{
value = toupper(*p) - (isdigit(*p) ? '0' : '7') << 4;