Skip to content

Commit c0261f5

Browse files
committed
Fix unintended C99 usage (Issue #1742)
1 parent 0f38890 commit c0261f5

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎CHANGES.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CHANGES - OpenPrinting CUPS
55
v2.4.21 - YYYY-MM-DD
66
--------------------
77

8+
- Fixed unintended usage of C99 language feature (Issue #1742)
89
- Fixed regression in mailto notifier address validation (Issue #1744)
910

1011

‎cups/ppd-cache.c‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,7 @@ _ppdCacheCreateWithPPD(ppd_file_t *ppd) /* I - PPD file */
20822082
void
20832083
_ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */
20842084
{
2085-
int i; /* Looping var */
2085+
int i, j; /* Looping vars */
20862086
pwg_map_t *map; /* Current map */
20872087
pwg_size_t *size; /* Current size */
20882088

@@ -2168,11 +2168,14 @@ _ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */
21682168

21692169
cupsArrayDelete(pc->templates);
21702170

2171-
for (i = _PWG_PRINT_COLOR_MODE_MONOCHROME;
2172-
i < _PWG_PRINT_COLOR_MODE_MAX; i ++)
2173-
for (int j = _PWG_PRINT_QUALITY_DRAFT; j < _PWG_PRINT_QUALITY_MAX; j ++)
2171+
for (i = _PWG_PRINT_COLOR_MODE_MONOCHROME; i < _PWG_PRINT_COLOR_MODE_MAX; i ++)
2172+
{
2173+
for (j = _PWG_PRINT_QUALITY_DRAFT; j < _PWG_PRINT_QUALITY_MAX; j ++)
2174+
{
21742175
if (pc->num_presets[i][j])
21752176
cupsFreeOptions(pc->num_presets[i][j], pc->presets[i][j]);
2177+
}
2178+
}
21762179

21772180
free(pc);
21782181
}

0 commit comments

Comments
 (0)