X-Git-Url: https://git.distorted.org.uk/~mdw/adns/blobdiff_plain/620c146da30a20c2d9a6c572fdd0540558039d0e..73eb26037c46bebeaa30ba38eba887216f0e9a6e:/src/parse.c diff --git a/src/parse.c b/src/parse.c index 5c4bdaf..b643e89 100644 --- a/src/parse.c +++ b/src/parse.c @@ -3,7 +3,12 @@ * - parsing assistance functions (mainly for domains inside datagrams) */ /* - * This file is part of adns, which is Copyright (C) 1997-1999 Ian Jackson + * This file is + * Copyright (C) 1997-2000 Ian Jackson + * + * It is part of adns, which is + * Copyright (C) 1997-2000 Ian Jackson + * Copyright (C) 1999 Tony Finch * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,13 +35,12 @@ int vbuf__append_quoted1035(vbuf *vb, const byte *buf, int len) { qbuf[0]= 0; for (i=0; i= 127) { + if (ch <= ' ' || ch >= 127) { sprintf(qbuf,"\\%03o",ch); break; + } else if (!ctype_domainunquoted(ch)) { + sprintf(qbuf,"\\%c",ch); + break; } } if (!adns__vbuf_append(vb,buf,i) || !adns__vbuf_append(vb,qbuf,strlen(qbuf)))