X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fparse.c;h=b643e8948815ce6182691b76177c42aba747a676;hb=806b3e0ad953d4c3aa52c47573ea525196191b19;hp=5c4bdaf7a9196fe9ffbc67eb52c8dbd4c21cc427;hpb=eaa4473118b245a9dc1d806309eb70d4b2c6eaa4;p=adns.git 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)))