legacy_hc.c revision 2
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A#
pragma ident "%Z%%M% %I% %E% SMI" 2N/A * Turn on module debugging output 2N/A return (-
1);
/* mod errno already set */ 2N/A * Convert an input string to a URI escaped string and return the new string. 2N/A * RFC2396 Section 2.4 says that data must be escaped if it does not have a 2N/A * representation using an unreserved character, where an unreserved character 2N/A * is one that is either alphanumeric or one of the marks defined in S2.3. 2N/A for (p = s; (c = *p) !=
'\0'; p++) {
2N/A n++;
/* represent c as itself */ 2N/A n +=
3;
/* represent c as escape */ 2N/A for (p = s, q =
buf; (c = *p) !=
'\0' && q <
buf +
len; p++) {
2N/A q--;
/* len is too small: truncate output string */