/*
- * "$Id: ppd.c 9900 2011-08-17 20:59:46Z mike $"
+ * "$Id$"
*
* PPD file routines for CUPS.
*
- * Copyright 2007-2011 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
/*
* 'ppdErrorString()' - Returns the text assocated with a status.
*
- * @since CUPS 1.1.19/Mac OS X 10.3@
+ * @since CUPS 1.1.19/OS X 10.3@
*/
const char * /* O - Status string */
/*
* 'ppdLastError()' - Return the status from the last ppdOpen*().
*
- * @since CUPS 1.1.19/Mac OS X 10.3@
+ * @since CUPS 1.1.19/OS X 10.3@
*/
ppd_status_t /* O - Status code */
/*
* '_ppdOpen()' - Read a PPD file into memory.
*
- * @since CUPS 1.2/Mac OS X 10.5@
+ * @since CUPS 1.2/OS X 10.5@
*/
ppd_file_t * /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
ppd->patches = temp;
- strcpy(ppd->patches + strlen(ppd->patches), string);
+ memcpy(ppd->patches + strlen(ppd->patches), string, strlen(string) + 1);
}
}
else if (!strcmp(keyword, "OpenUI"))
*/
if (!_cups_strcasecmp(name, "PageRegion"))
- strcpy(custom_name, "CustomPageSize");
+ strlcpy(custom_name, "CustomPageSize", sizeof(custom_name));
else
snprintf(custom_name, sizeof(custom_name), "Custom%s", name);
cupsCharsetToUTF8((cups_utf8_t *)choice->text, text,
sizeof(choice->text), encoding);
else if (!strcmp(name, "True"))
- strcpy(choice->text, _("Yes"));
+ strlcpy(choice->text, _("Yes"), sizeof(choice->text));
else if (!strcmp(name, "False"))
- strcpy(choice->text, _("No"));
+ strlcpy(choice->text, _("No"), sizeof(choice->text));
else
strlcpy(choice->text, name, sizeof(choice->text));
/*
* 'ppdOpen2()' - Read a PPD file into memory.
*
- * @since CUPS 1.2/Mac OS X 10.5@
+ * @since CUPS 1.2/OS X 10.5@
*/
ppd_file_t * /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
/*
* 'ppdSetConformance()' - Set the conformance level for PPD files.
*
- * @since CUPS 1.1.20/Mac OS X 10.4@
+ * @since CUPS 1.1.20/OS X 10.4@
*/
void
DEBUG_printf(("9ppd_read: LINE=\"%s\"", line->buffer));
/*
- * The dynamically created PPDs for older style Mac OS X
+ * The dynamically created PPDs for older style OS X
* drivers include a large blob of data inserted as comments
* at the end of the file. As an optimization we can stop
* reading the PPD when we get to the start of this data.
/*
- * End of "$Id: ppd.c 9900 2011-08-17 20:59:46Z mike $".
+ * End of "$Id$".
*/