summaryrefslogtreecommitdiff
path: root/devices/gdevplan.c
diff options
context:
space:
mode:
Diffstat (limited to 'devices/gdevplan.c')
-rw-r--r--devices/gdevplan.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/devices/gdevplan.c b/devices/gdevplan.c
index b91f61d00..84640a74c 100644
--- a/devices/gdevplan.c
+++ b/devices/gdevplan.c
@@ -248,13 +248,17 @@ static void dump_row_pnmc(int w, byte **data, gp_file *dump_file)
static void dump_row_pbm(int w, byte **data, gp_file *dump_file)
{
byte *r = data[0];
+ int mask = ~(255>>(w&7));
if (dump_file == NULL)
return;
+ if (w == 0)
+ return;
w = (w+7)>>3;
- while (w--) {
+ while (--w) {
gp_fputc(*r++, dump_file);
}
+ gp_fputc(mask & *r, dump_file);
}
static void dump_row_pgm(int w, byte **data, gp_file *dump_file)