/*
- * "$Id: http-support.c 5360 2006-03-30 17:02:17Z mike $"
+ * "$Id: http-support.c 6649 2007-07-11 21:46:42Z mike $"
*
* HTTP support routines for the Common UNIX Printing System (CUPS) scheduler.
*
- * Copyright 1997-2006 by Easy Software Products, all rights reserved.
+ * Copyright 2007 by Apple Inc.
+ * Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
- * property of Easy Software Products and are protected by Federal
- * copyright law. Distribution and use rights are outlined in the file
- * "LICENSE.txt" which should have been included with this file. If this
- * file is missing or damaged please contact Easy Software Products
- * at:
- *
- * Attn: CUPS Licensing Information
- * Easy Software Products
- * 44141 Airport View Drive, Suite 204
- * Hollywood, Maryland 20636 USA
- *
- * Voice: (301) 373-9600
- * EMail: cups-info@cups.org
- * WWW: http://www.cups.org
+ * property of Apple Inc. and are protected by Federal copyright
+ * law. Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file. If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
*
* This file is subject to the Apple OS-Developed Software exception.
*
if (!ptr)
goto assemble_overflow;
- if (!strcmp(scheme, "mailto:"))
+ if (!strcmp(scheme, "mailto"))
{
/*
* mailto: only has :, no //...
httpEncode64(char *out, /* I - String to write to */
const char *in) /* I - String to read from */
{
- return (httpEncode64_2(out, 512, in, strlen(in)));
+ return (httpEncode64_2(out, 512, in, (int)strlen(in)));
}
if (outptr < outend)
*outptr ++ = base64[(in[0] & 255) >> 2];
+
if (outptr < outend)
- *outptr ++ = base64[(((in[0] & 255) << 4) | ((in[1] & 255) >> 4)) & 63];
+ {
+ if (inlen > 1)
+ *outptr ++ = base64[(((in[0] & 255) << 4) | ((in[1] & 255) >> 4)) & 63];
+ else
+ *outptr ++ = base64[((in[0] & 255) << 4) & 63];
+ }
in ++;
inlen --;
}
if (outptr < outend)
- *outptr ++ = base64[(((in[0] & 255) << 2) | ((in[1] & 255) >> 6)) & 63];
+ {
+ if (inlen > 1)
+ *outptr ++ = base64[(((in[0] & 255) << 2) | ((in[1] & 255) >> 6)) & 63];
+ else
+ *outptr ++ = base64[((in[0] & 255) << 2) & 63];
+ }
in ++;
inlen --;
char *resptr = resource + strlen(resource);
- uri = http_copy_decode(resptr, uri, resourcelen - (resptr - resource),
+ uri = http_copy_decode(resptr, uri, resourcelen - (int)(resptr - resource),
NULL, decoding & HTTP_URI_CODING_QUERY);
}
}
/*
- * End of "$Id: http-support.c 5360 2006-03-30 17:02:17Z mike $".
+ * End of "$Id: http-support.c 6649 2007-07-11 21:46:42Z mike $".
*/