]> git.marmaro.de Git - mmh/blobdiff - uip/dp.c
Added argument to fmt_scan() to specify the buffer size.
[mmh] / uip / dp.c
index 6b41bb627403708b2b87d13d549f741f0833fef5..95a71637f93337c58c9c0864cb1b77c7d045ffba 100644 (file)
--- a/uip/dp.c
+++ b/uip/dp.c
@@ -2,8 +2,6 @@
 /*
  * dp.c -- parse dates 822-style
  *
- * $Id$
- *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * complete copyright information.
@@ -38,11 +36,6 @@ static struct format *fmt;
 
 static int dat[5];
 
-/*
- * prototypes
- */
-int sc_width (void);  /* from termsbr.c */
-
 /*
  * static prototypes
  */
@@ -81,10 +74,10 @@ main (int argc, char **argv)
                    snprintf (buf, sizeof(buf), "%s [switches] dates ...",
                        invo_name);
                    print_help (buf, switches, 1);
-                   done (1);
+                   done (0);
                case VERSIONSW:
                    print_version(invo_name);
-                   done (1);
+                   done (0);
 
                case FORMSW: 
                    if (!(form = *argp++) || *form == '-')
@@ -151,7 +144,7 @@ process (char *date, int length)
     FINDCOMP (cptr, "text");
     if (cptr)
        cptr->c_text = date;
-    fmt_scan (fmt, buffer, length, dat);
+    fmt_scan (fmt, buffer, sizeof buffer - 1, length, dat);
     fputs (buffer, stdout);
 
     return status;