2008-05-22 Peter Maydell <pmaydell@chiark.greenend.org.uk>
+ * uip/scansbr.c: don't use MB_CUR_MAX if we aren't compiled
+ with multibyte support.
+
* uip/whatnowsbr.c: factor out common code for writing ls
shell command, and make it do more sensible buffer length
checks. Also avoid relying on the return value of sprintf(),
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,
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());