Skip to content

Commit 14845fc

Browse files
authored
Merge pull request #22 from janhn/master
sanitize columns input value
2 parents ca4659a + 8542a22 commit 14845fc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/paps.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,11 @@ int main(int argc, char *argv[])
667667
glyph_font_size = pango_font_description_get_size(font_description) / PANGO_SCALE;
668668
pango_context_set_font_description (pango_context, font_description);
669669

670+
if (num_columns <= 0) {
671+
fprintf(stderr, _("%s: Invalid input: --columns=%d, using default.\n"), g_get_prgname (), num_columns);
672+
num_columns = 1;
673+
}
674+
670675
if (num_columns == 1)
671676
total_gutter_width = 0;
672677
else

0 commit comments

Comments
 (0)