X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/2adafe760a9c45b417727a3f5d9481de26471a8b..803f25412:/uip/dp.c?ds=sidebyside diff --git a/uip/dp.c b/uip/dp.c index 2e071973..cf8f9b14 100644 --- a/uip/dp.c +++ b/uip/dp.c @@ -108,11 +108,11 @@ main (int argc, char **argv) if ((width = sc_width ()) < WIDTH / 2) { /* Default: width of the terminal, but at least WIDTH/2. */ width = WIDTH / 2; - } else if (width == 0) { - /* Unlimited width. */ - width = INT_MAX; } width -= 2; + } else if (width == 0) { + /* Unlimited width. */ + width = INT_MAX; } fmt_compile (nfs, &fmt, 1); @@ -136,7 +136,8 @@ static int process (char *date, int length) { int status = 0; - charstring_t scanl = charstring_create (length); + charstring_t scanl = + charstring_create (length < NMH_BUFSIZ ? length : NMH_BUFSIZ); register struct comp *cptr; cptr = fmt_findcomp ("text");