Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347738
b: refs/heads/master
c: fc96b21
h: refs/heads/master
v: v3
  • Loading branch information
Andreas Bießmann authored and Michal Marek committed Nov 20, 2012
1 parent cf91ef9 commit de9aa42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 16f890988114a1b2d7abb30dafb708d4513801da
refs/heads/master: fc96b211bc6fa917bfb07a8db4cd898663e5f2c6
7 changes: 7 additions & 0 deletions trunk/scripts/pnmtologo.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ static unsigned int logo_height;
static struct color **logo_data;
static struct color logo_clut[MAX_LINUX_LOGO_COLORS];
static unsigned int logo_clutsize;
static int is_plain_pbm = 0;

static void die(const char *fmt, ...)
__attribute__ ((noreturn)) __attribute ((format (printf, 1, 2)));
Expand Down Expand Up @@ -103,6 +104,11 @@ static unsigned int get_number(FILE *fp)
val = 0;
while (isdigit(c)) {
val = 10*val+c-'0';
/* some PBM are 'broken'; GiMP for example exports a PBM without space
* between the digits. This is Ok cause we know a PBM can only have a '1'
* or a '0' for the digit. */
if (is_plain_pbm)
break;
c = fgetc(fp);
if (c == EOF)
die("%s: end of file\n", filename);
Expand Down Expand Up @@ -167,6 +173,7 @@ static void read_image(void)
switch (magic) {
case '1':
/* Plain PBM */
is_plain_pbm = 1;
for (i = 0; i < logo_height; i++)
for (j = 0; j < logo_width; j++)
logo_data[i][j].red = logo_data[i][j].green =
Expand Down

0 comments on commit de9aa42

Please sign in to comment.