Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cups/dest-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,6 +1719,9 @@ cups_create_media_db(
cups_array_t *db; // New media database array
_cups_media_db_t mdb; // Media entry
char media_key[256]; // Synthesized media-key value
pwg_media_t temppwg; // Temporary PWG media info
char keyword[128], // PWG size keyword
ppdname[41]; // PPD size name


db = cupsArrayNew((cups_array_cb_t)cups_compare_media_db, NULL, NULL, 0, (cups_acopy_cb_t)cups_copy_media_db, (cups_afree_cb_t)cups_free_media_db);
Expand Down Expand Up @@ -1839,12 +1842,8 @@ cups_create_media_db(

if (!mdb.key)
{
pwg_media_t temppwg; // PWG media info
char keyword[128], // PWG size keyword
ppdname[41]; // PPD size name

if (!mdb.size_name && _pwgMediaNearSize(&temppwg, keyword, sizeof(keyword), ppdname, sizeof(ppdname), mdb.width, mdb.length, _PWG_EPSILON))
mdb.size_name = keyword;
if (!mdb.size_name && (pwg = _pwgMediaNearSize(&temppwg, keyword, sizeof(keyword), ppdname, sizeof(ppdname), mdb.width, mdb.length, _PWG_EPSILON)) != NULL)
mdb.size_name = (char *)pwg->pwg;

if (!mdb.size_name)
{
Expand Down
Loading