b37900
diff -urNp a/converter/other/fiasco/lib/error.c b/converter/other/fiasco/lib/error.c
b37900
--- a/converter/other/fiasco/lib/error.c	2018-09-26 11:45:35.787418476 +0200
b37900
+++ b/converter/other/fiasco/lib/error.c	2018-09-27 08:35:35.051707228 +0200
b37900
@@ -89,8 +89,10 @@ set_error(const char *format, ...) {
b37900
         } else if (*str == 'c') {
b37900
             (void)va_arg(args, int);
b37900
             len += 1;
b37900
-        } else
b37900
+        } else {
b37900
+            va_end(args);
b37900
             return;
b37900
+        }
b37900
         ++str;
b37900
     }
b37900
     va_end(args);
b37900
@@ -204,8 +206,10 @@ warning (const char *format, ...)
b37900
 
b37900
    VA_START (args, format);
b37900
 
b37900
-   if (verboselevel == FIASCO_NO_VERBOSITY)
b37900
+   if (verboselevel == FIASCO_NO_VERBOSITY) {
b37900
+      va_end (args);
b37900
       return;
b37900
+   }
b37900
 	
b37900
    fprintf (stderr, "Warning: ");
b37900
    vfprintf (stderr, format, args);
b37900
@@ -224,8 +228,10 @@ message (const char *format, ...)
b37900
 
b37900
    VA_START (args, format);
b37900
 
b37900
-   if (verboselevel == FIASCO_NO_VERBOSITY)
b37900
+   if (verboselevel == FIASCO_NO_VERBOSITY) {
b37900
+      va_end(args);
b37900
       return;
b37900
+   }
b37900
 
b37900
    vfprintf (stderr, format, args);
b37900
    fputc ('\n', stderr);
b37900
@@ -242,8 +248,10 @@ debug_message (const char *format, ...)
b37900
 
b37900
    VA_START (args, format);
b37900
 
b37900
-   if (verboselevel < FIASCO_ULTIMATE_VERBOSITY)
b37900
+   if (verboselevel < FIASCO_ULTIMATE_VERBOSITY) {
b37900
+      va_end (args);
b37900
       return;
b37900
+   }
b37900
 
b37900
    fprintf (stderr, "*** ");
b37900
    vfprintf (stderr, format, args);
b37900
@@ -261,8 +269,10 @@ info (const char *format, ...)
b37900
 
b37900
    VA_START (args, format);
b37900
 
b37900
-   if (verboselevel == FIASCO_NO_VERBOSITY)
b37900
+   if (verboselevel == FIASCO_NO_VERBOSITY) {
b37900
+      va_end (args);
b37900
       return;
b37900
+   }
b37900
 
b37900
    vfprintf (stderr, format, args);
b37900
    fflush (stderr);
b37900
diff -urNp a/converter/other/gemtopnm.c b/converter/other/gemtopnm.c
b37900
--- a/converter/other/gemtopnm.c	2018-09-26 11:45:35.791418469 +0200
b37900
+++ b/converter/other/gemtopnm.c	2018-09-27 08:36:51.058648634 +0200
b37900
@@ -101,10 +101,11 @@ main(argc, argv)
b37900
 
b37900
     if (planes == 1) 
b37900
         type = PBM_TYPE;
b37900
-    else 
b37900
+    else  
b37900
         type = PPM_TYPE;
b37900
 
b37900
-	pnm_writepnminit( stdout, cols, rows, MAXVAL, type, 0 );
b37900
+    pnm_writepnminit( stdout, cols, rows, MAXVAL, type, 0 );
b37900
+    
b37900
 
b37900
     overflow_add(cols, padright);
b37900
     { 
b37900
diff -urNp a/converter/other/jbig/jbigtopnm.c b/converter/other/jbig/jbigtopnm.c
b37900
--- a/converter/other/jbig/jbigtopnm.c	2018-09-26 11:45:35.779418489 +0200
b37900
+++ b/converter/other/jbig/jbigtopnm.c	2018-09-26 12:30:12.498686400 +0200
b37900
@@ -279,6 +279,7 @@ int main (int argc, char **argv)
b37900
     }
b37900
   
b37900
     pm_close(fout);
b37900
+    pm_close(fin);
b37900
 
b37900
     jbg_dec_free(&s);
b37900
 
b37900
diff -urNp a/converter/other/jbig/libjbig/jbig.c b/converter/other/jbig/libjbig/jbig.c
b37900
--- a/converter/other/jbig/libjbig/jbig.c	2018-09-26 11:45:35.779418489 +0200
b37900
+++ b/converter/other/jbig/libjbig/jbig.c	2018-09-26 12:32:47.179520102 +0200
b37900
@@ -887,7 +887,7 @@ void jbg_enc_options(struct jbg_enc_stat
b37900
   if (order >= 0 && order <= 0x0f) s->order = order;
b37900
   if (options >= 0) s->options = options;
b37900
   if (l0 > 0) s->l0 = l0;
b37900
-  if (mx >= 0 && my < 128) s->mx = mx;
b37900
+  if (mx >= 0 && mx < 128) s->mx = mx;
b37900
   if (my >= 0 && my < 256) s->my = my;
b37900
 
b37900
   return;
b37900
diff -urNp a/converter/other/jpeg2000/jpeg2ktopam.c b/converter/other/jpeg2000/jpeg2ktopam.c
b37900
--- a/converter/other/jpeg2000/jpeg2ktopam.c	2018-09-26 11:45:35.774418498 +0200
b37900
+++ b/converter/other/jpeg2000/jpeg2ktopam.c	2018-09-26 12:47:13.369571321 +0200
b37900
@@ -135,11 +135,11 @@ readJ2k(const char *   const inputFilena
b37900
 
b37900
     jasperP = jas_image_decode(instreamP, jas_image_getfmt(instreamP),
b37900
                                (char*)options);
b37900
-    if (jasperP == NULL)
b37900
+    if (jasperP == NULL) {
b37900
         pm_error("Unable to interpret JPEG-2000 input.  "
b37900
                  "The Jasper library jas_image_decode() subroutine failed.");
b37900
-
b37900
-	jas_stream_close(instreamP);
b37900
+    }
b37900
+    jas_stream_close(instreamP);
b37900
 
b37900
     *jasperPP = jasperP;
b37900
 }
b37900
diff -urNp a/converter/other/jpeg2000/libjasper/jpc/jpc_util.c b/converter/other/jpeg2000/libjasper/jpc/jpc_util.c
b37900
--- a/converter/other/jpeg2000/libjasper/jpc/jpc_util.c	2018-09-26 11:45:35.774418498 +0200
b37900
+++ b/converter/other/jpeg2000/libjasper/jpc/jpc_util.c	2018-09-26 12:50:30.121353853 +0200
b37900
@@ -151,7 +151,7 @@ int jpc_atoaf(const char *s, int *numval
b37900
 	if ((cp = strtok(buf, delim))) {
b37900
 		++n;
b37900
 		while ((cp = strtok(0, delim))) {
b37900
-			if (cp != '\0') {
b37900
+			if (*cp != '\0') {
b37900
 				++n;
b37900
 			}
b37900
 		}
b37900
@@ -169,7 +169,7 @@ int jpc_atoaf(const char *s, int *numval
b37900
 			vs[n] = atof(cp);
b37900
 			++n;
b37900
 			while ((cp = strtok(0, delim))) {
b37900
-				if (cp != '\0') {
b37900
+				if (*cp != '\0') {
b37900
 					vs[n] = atof(cp);
b37900
 					++n;
b37900
 				}
b37900
diff -urNp a/converter/other/jpeg2000/pamtojpeg2k.c b/converter/other/jpeg2000/pamtojpeg2k.c
b37900
--- a/converter/other/jpeg2000/pamtojpeg2k.c	2018-09-26 11:45:35.774418498 +0200
b37900
+++ b/converter/other/jpeg2000/pamtojpeg2k.c	2018-09-26 12:52:06.202247510 +0200
b37900
@@ -355,7 +355,7 @@ convertToJasperImage(struct pam *   cons
b37900
                                   JAS_IMAGE_CT_COLOR(JAS_IMAGE_CT_RGB_B));
b37900
         }
b37900
     } else {
b37900
-        if (strncmp(inpamP->tuple_type, "GRAYSCALE", 9 == 0) ||
b37900
+        if (strncmp(inpamP->tuple_type, "GRAYSCALE", 9) == 0 ||
b37900
             strncmp(inpamP->tuple_type, "BLACKANDWHITE", 13) == 0) {
b37900
             jas_image_setclrspc(jasperP, JAS_CLRSPC_GENGRAY);
b37900
             jas_image_setcmpttype(jasperP, 0,
b37900
diff -urNp a/converter/pbm/pbmtoln03.c b/converter/pbm/pbmtoln03.c
b37900
--- a/converter/pbm/pbmtoln03.c	2018-09-26 11:45:35.769418507 +0200
b37900
+++ b/converter/pbm/pbmtoln03.c	2018-09-26 13:15:36.205121268 +0200
b37900
@@ -80,22 +80,25 @@ output_sixel_record (unsigned char * rec
b37900
             /* Do an encoding */
b37900
             record[j++] = '!' ;
b37900
             sprintf (repeated_str, "%d", i - start_repeat) ;
b37900
-            for (p = repeated_str ; *p ; p++)
b37900
+            for (p = repeated_str ; *p ; p++) {
b37900
                record[j++] = *p ;
b37900
-               record[j++] = last_char ; }
b37900
+            }
b37900
+            record[j++] = last_char ; 
b37900
 
b37900
-         else {
b37900
+         } else {
b37900
             for (k = 0 ; k < repeated ; k++)
b37900
-               record[j++] = last_char ; }
b37900
+               record[j++] = last_char ; 
b37900
+         }
b37900
 
b37900
          start_repeat = i ;
b37900
-         last_char = record[i] ; }
b37900
+         last_char = record[i] ; 
b37900
       }
b37900
+   }
b37900
 
b37900
    fwrite ((char *) record, j, 1, stdout) ;
b37900
    putchar ('-') ;      /* DECGNL (graphics new-line) */
b37900
    putchar ('\n') ;
b37900
-   }
b37900
+}
b37900
 
b37900
 
b37900
 static void 
b37900
diff -urNp a/converter/pbm/pbmtomacp.c b/converter/pbm/pbmtomacp.c
b37900
--- a/converter/pbm/pbmtomacp.c	2018-09-26 11:45:35.769418507 +0200
b37900
+++ b/converter/pbm/pbmtomacp.c	2018-09-26 14:47:55.085913872 +0200
b37900
@@ -177,7 +177,7 @@ calculateCropPad(struct CmdlineInfo
b37900
             pm_message("Specified -bottom value %u is beyond edge of "
b37900
                        "input image", cmdline.bottom);
b37900
 
b37900
-            bottom = MIN3(cmdline.bottom, rows - 1, top + MACP_ROWS - 1);
b37900
+        bottom = MIN3(cmdline.bottom, rows - 1, top + MACP_ROWS - 1);
b37900
     } else
b37900
         bottom = MIN(rows - 1, top + MACP_ROWS - 1);
b37900
 
b37900
diff -urNp a/converter/pbm/pbmtoppa/pbm.c b/converter/pbm/pbmtoppa/pbm.c
b37900
--- a/converter/pbm/pbmtoppa/pbm.c	2018-09-26 11:45:35.769418507 +0200
b37900
+++ b/converter/pbm/pbmtoppa/pbm.c	2018-09-26 14:49:51.956959516 +0200
b37900
@@ -12,6 +12,7 @@
b37900
 #include <stdlib.h>
b37900
 #include <string.h>
b37900
 
b37900
+#include "ppm.h"
b37900
 #include "ppapbm.h"
b37900
 
b37900
 int make_pbm_stat(pbm_stat* pbm,FILE* fptr)
b37900
diff -urNp a/converter/ppm/pjtoppm.c b/converter/ppm/pjtoppm.c
b37900
--- a/converter/ppm/pjtoppm.c	2018-09-26 11:45:35.797418458 +0200
b37900
+++ b/converter/ppm/pjtoppm.c	2018-09-26 14:52:41.300937179 +0200
b37900
@@ -11,6 +11,7 @@
b37900
 */
b37900
 
b37900
 #include "ppm.h"
b37900
+#include "pm.h"
b37900
 #include "mallocvar.h"
b37900
 
b37900
 static char usage[] =  "[paintjetfile]";
b37900
diff -urNp a/converter/ppm/ppmtomitsu.c b/converter/ppm/ppmtomitsu.c
b37900
--- a/converter/ppm/ppmtomitsu.c	2018-09-26 11:45:35.797418458 +0200
b37900
+++ b/converter/ppm/ppmtomitsu.c	2018-09-26 14:56:09.837804961 +0200
b37900
@@ -651,9 +651,10 @@ main(int argc, char * argv[]) {
b37900
         dpi300 = TRUE;
b37900
     else if (pm_keymatch(argv[argn], "-tiny", 2))
b37900
         tiny = TRUE;
b37900
-    else
b37900
+    else 
b37900
         pm_usage(usage);
b37900
-        ++argn;
b37900
+
b37900
+    ++argn;   
b37900
     }
b37900
 
b37900
     if (argn < argc) {
b37900
diff -urNp a/converter/ppm/tgatoppm.c b/converter/ppm/tgatoppm.c
b37900
--- a/converter/ppm/tgatoppm.c	2018-09-26 11:45:35.795418462 +0200
b37900
+++ b/converter/ppm/tgatoppm.c	2018-09-26 15:03:12.084322787 +0200
b37900
@@ -168,8 +168,8 @@ get_pixel(FILE * const ifP, pixel * dest
b37900
 	Red = getbyte( ifP );
b37900
 	if ( Size == 32 )
b37900
 	    Alpha = getbyte( ifP );
b37900
-    else
b37900
-        Alpha = 0;
b37900
+        else
b37900
+            Alpha = 0;
b37900
 	l = 0;
b37900
 	break;
b37900
 
b37900
diff -urNp a/converter/ppm/xpmtoppm.c b/converter/ppm/xpmtoppm.c
b37900
--- a/converter/ppm/xpmtoppm.c	2018-09-26 11:45:35.795418462 +0200
b37900
+++ b/converter/ppm/xpmtoppm.c	2018-09-26 15:09:39.763747185 +0200
b37900
@@ -941,8 +941,8 @@ convertRaster(FILE *                cons
b37900
         if (imageOutFileP)
b37900
             ppm_writeppmrow(imageOutFileP, 
b37900
                             pixrow, cols, PPM_MAXMAXVAL, 0);
b37900
-            if (alphaOutFileP)
b37900
-                pbm_writepbmrow(alphaOutFileP, alpharow, cols, 0);
b37900
+        if (alphaOutFileP)
b37900
+            pbm_writepbmrow(alphaOutFileP, alpharow, cols, 0);
b37900
     }
b37900
 
b37900
     pbm_freerow(alpharow);
b37900
diff -urNp a/editor/pnmconvol.c b/editor/pnmconvol.c
b37900
--- a/editor/pnmconvol.c	2018-09-26 11:45:35.758418526 +0200
b37900
+++ b/editor/pnmconvol.c	2018-09-26 15:25:06.963058646 +0200
b37900
@@ -733,7 +733,7 @@ parsePlaneFileLine(const char *   const
b37900
                          "-matrix value is not a valid floating point "
b37900
                          "number", colCt, line);
b37900
 
b37900
-                ++colCt;
b37900
+            ++colCt;
b37900
         }
b37900
         pm_strfree(token);
b37900
     }
b37900
diff -urNp a/generator/pbmtext.c b/generator/pbmtext.c
b37900
--- a/generator/pbmtext.c	2018-09-26 11:45:35.727418580 +0200
b37900
+++ b/generator/pbmtext.c	2018-09-26 15:29:14.618407929 +0200
b37900
@@ -404,7 +404,7 @@ fixControlChars(const PM_WCHAR  * const
b37900
                 output[outCursor++] = L' ';
b37900
         } else if (currentChar > fontP->maxglyph ||
b37900
                    !fontP->glyph[currentChar]) {
b37900
-        if (currentChar > PM_FONT2_MAXGLYPH)
b37900
+        if (currentChar > PM_FONT2_MAXGLYPH){
b37900
             pm_message("code point %X is beyond what this program "
b37900
                        "can handle.  Max=%X",
b37900
                        (unsigned int)currentChar, PM_FONT2_MAXGLYPH);
b37900
@@ -420,15 +420,15 @@ fixControlChars(const PM_WCHAR  * const
b37900
                                (unsigned int) currentChar );
b37900
                 output[outCursor++] = ' ';
b37900
             }
b37900
+        }
b37900
         } else
b37900
             output[outCursor++] = input[inCursor];
b37900
-
b37900
+        
b37900
         assert(outCursor <= outputSize);
b37900
     }
b37900
     output[outCursor++] = L'\0';
b37900
 
b37900
     assert(outCursor <= outputSize);
b37900
-
b37900
     *outputP = output;
b37900
 }
b37900
 
b37900
diff -urNp a/lib/libpm.c b/lib/libpm.c
b37900
--- a/lib/libpm.c	2018-09-26 11:45:35.768418509 +0200
b37900
+++ b/lib/libpm.c	2018-09-27 08:20:50.933203723 +0200
b37900
@@ -437,9 +437,10 @@ pm_maxvaltobits(int const maxval) {
b37900
         return 15;
b37900
     else if ( (long) maxval <= 65535L )
b37900
         return 16;
b37900
-    else
b37900
+    else {
b37900
         pm_error( "maxval of %d is too large!", maxval );
b37900
         return -1;  /* Should never come here */
b37900
+    }
b37900
 }
b37900
 
b37900
 int
b37900
diff -urNp a/other/pamfix.c b/other/pamfix.c
b37900
--- a/other/pamfix.c	2018-09-26 11:45:35.755418531 +0200
b37900
+++ b/other/pamfix.c	2018-09-27 08:23:00.923166374 +0200
b37900
@@ -184,7 +184,7 @@ clipPamRow(const struct pam * const pamP
b37900
                                "image maxval of %lu",
b37900
                                row, col, plane, tuplerow[col][plane],
b37900
                                pamP->maxval);
b37900
-	            tuplerow[col][plane] = pamP->maxval;
b37900
+	        tuplerow[col][plane] = pamP->maxval;
b37900
             }
b37900
         }
b37900
     }
b37900
diff -urNp a/other/pnmcolormap.c b/other/pnmcolormap.c
b37900
--- a/other/pnmcolormap.c	2018-09-26 11:45:35.756418529 +0200
b37900
+++ b/other/pnmcolormap.c	2018-09-27 08:28:57.053986251 +0200
b37900
@@ -838,9 +838,10 @@ colormapToSquare(struct pam * const pamP
b37900
         unsigned int const intsqrt = (int)sqrt((float)colormap.size);
b37900
         if (intsqrt * intsqrt == colormap.size) 
b37900
             pamP->width = intsqrt;
b37900
-        else 
b37900
+        else { 
b37900
             pamP->width = intsqrt + 1;
b37900
             overflow_add(intsqrt, 1);
b37900
+        }
b37900
     }
b37900
     {
b37900
         unsigned int const intQuotient = colormap.size / pamP->width;