openbsd-ports/print/cups-pdf/patches/patch-src_cups-pdf_c
ajacoutot 097416b041 Update to cups-pdf-2.5.0.
Tweak MESSAGE accordingly.
2009-09-08 14:02:45 +00:00

28 lines
1.0 KiB
Plaintext

$OpenBSD: patch-src_cups-pdf_c,v 1.3 2009/09/08 14:02:46 ajacoutot Exp $
--- src/cups-pdf.c.orig Fri Sep 4 22:57:29 2009
+++ src/cups-pdf.c Fri Sep 4 22:58:42 2009
@@ -71,11 +71,11 @@ static void log_event(short type, char message[], char
timestring[strlen(timestring)-1]='\0';
if (type == CPERROR)
- sprintf(ctype, "ERROR");
+ snprintf(ctype, sizeof(ctype), "ERROR");
else if (type == CPSTATUS)
- sprintf(ctype, "STATUS");
+ snprintf(ctype, sizeof(ctype), "STATUS");
else
- sprintf(ctype, "DEBUG");
+ snprintf(ctype, sizeof(ctype), "DEBUG");
if (detail != NULL) {
while (detail[strlen(detail)-1] == '\n')
detail[strlen(detail)-1]='\0';
@@ -507,7 +507,7 @@ static int preparespoolfile(FILE *fpsrc, char *spoolfi
}
else {
if (conf.label) {
- strcpy(buffer, title);
+ strlcpy(buffer, title, sizeof(buffer));
snprintf(title, BUFSIZE, "job_%i-%s", job, buffer);
}
log_event(CPDEBUG, "title successfully retrieved", title);