]> git.marmaro.de Git - mmh/blobdiff - uip/scansbr.c
Add protective 'do { ... } while (0)' wrappers to multistatement macros
[mmh] / uip / scansbr.c
index 1b6a0ed9ec9ffdfe34929eb4bb09216c3bb2abc8..6a9278bbd539895d2f636d2c8a16abba032c45cc 100644 (file)
@@ -68,6 +68,11 @@ char *scanl = 0;                     /* text of most recent scanline    */
 int sc_width (void);                   /* from termsbr.c */
 static int mh_fputs(char *, FILE *);
 
+#ifdef MULTIBYTE_SUPPORT
+#define SCAN_CHARWIDTH MB_CUR_MAX
+#else
+#define SCAN_CHARWIDTH 1
+#endif
 
 int
 scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg,
@@ -98,7 +103,7 @@ scan (FILE *inb, int innum, int outnum, char *nfs, int width, int curflg,
                width = MAXSCANL;
        }
        dat[3] = slwidth = width;
-       scanl = (char *) mh_xmalloc((size_t) MB_CUR_MAX * (slwidth + 2) );
+       scanl = (char *) mh_xmalloc((size_t) SCAN_CHARWIDTH * (slwidth + 2) );
        if (outnum)
            umask(~m_gmprot());