diff --git a/ppm.c b/ppm.c index dff7ad564645c5e6a620e42ee8e325842d930559..b607c77a3af7fe1b392d3c0b54ab209a8aed9dce 100644 --- a/ppm.c +++ b/ppm.c @@ -65,20 +65,23 @@ } break; case 1: { - if (isdigit(c)) + if (isdigit(c)) { img.width = img.width * 10 + (c - '0'); + } } break; case 2: { - if (isdigit(c)) + if (isdigit(c)) { img.height = img.height * 10 + (c - '0'); + } } break; case 3: { - if (isdigit(c)) + if (isdigit(c)) { img.color_space = img.color_space * 10 + (c - '0'); + } } break; } } else {