]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/ppd-emit.c
Changelog.
[thirdparty/cups.git] / cups / ppd-emit.c
index 6d053894152f48abe5ef030c6fe7ac3cd8f7d140..b9b0e5ad083e64232efe5a7ffa75ac57c3641964 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PPD code emission routines for CUPS.
  *
- * Copyright 2007-2015 by Apple Inc.
+ * Copyright 2007-2019 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
@@ -441,6 +441,9 @@ ppdEmitJCL(ppd_file_t *ppd,         /* I - PPD file record */
     * Clean up the job title...
     */
 
+    if (!title)
+      title = "Unknown";
+
     if ((ptr = strrchr(title, '/')) != NULL)
     {
      /*
@@ -490,6 +493,9 @@ ppdEmitJCL(ppd_file_t *ppd,         /* I - PPD file record */
     * issues with some printer's PJL implementations...
     */
 
+    if (!user)
+      user = "anonymous";
+
     snprintf(displaymsg, sizeof(displaymsg), "%d %s %s", job_id, user, temp);
 
    /*
@@ -832,7 +838,7 @@ ppdEmitString(ppd_file_t    *ppd,   /* I - PPD file record */
            *bufptr++ = *cptr++;
        }
       }
-      else
+      else if (choices[i]->code)
       {
        /*
         * Otherwise just copy the option code directly...
@@ -1065,7 +1071,7 @@ ppdEmitString(ppd_file_t    *ppd, /* I - PPD file record */
       DEBUG_printf(("2ppdEmitString: Offset in string is %d...",
                     (int)(bufptr - buffer)));
     }
-    else
+    else if (choices[i]->code)
     {
       strlcpy(bufptr, choices[i]->code, (size_t)(bufend - bufptr + 1));
       bufptr += strlen(bufptr);