diff options
author | obrien <obrien@FreeBSD.org> | 2000-06-26 08:06:22 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2000-06-26 08:06:22 +0000 |
commit | 188abf10cc1d39f9517f19d94881bd997bf5aa8f (patch) | |
tree | 816c55034ab47ac28bc0db5a0d9e263a5b516ee3 /contrib/isc-dhcp/common/options.c | |
parent | ceecbe9d5e9f6710e3bb7396529fce457402dfd8 (diff) | |
parent | 8bf3d0eae63400031a65954b5b5f2f7c49757d1a (diff) | |
download | FreeBSD-src-188abf10cc1d39f9517f19d94881bd997bf5aa8f.zip FreeBSD-src-188abf10cc1d39f9517f19d94881bd997bf5aa8f.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r62104,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/isc-dhcp/common/options.c')
-rw-r--r-- | contrib/isc-dhcp/common/options.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/contrib/isc-dhcp/common/options.c b/contrib/isc-dhcp/common/options.c index 21e1359..b80ffa1 100644 --- a/contrib/isc-dhcp/common/options.c +++ b/contrib/isc-dhcp/common/options.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: options.c,v 1.26.2.10 1999/05/06 21:54:34 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; +"$Id: options.c,v 1.26.2.11 2000/06/24 07:24:02 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #define DHCP_OPTION_DATA @@ -550,8 +550,22 @@ char *pretty_print_option (code, data, len, emit_commas, emit_quotes) case 't': if (emit_quotes) *op++ = '"'; - strcpy (op, (char *)dp); - op += strlen ((char *)dp); + for (; dp < data + len; dp++) { + if (!isascii (*dp) || + !isprint (*dp)) { + sprintf (op, "\\%03o", + *dp); + op += 4; + } else if (*dp == '"' || + *dp == '\'' || + *dp == '$' || + *dp == '`' || + *dp == '\\') { + *op++ = '\\'; + *op++ = *dp; + } else + *op++ = *dp; + } if (emit_quotes) *op++ = '"'; *op = 0; |