#include <h/fmt_scan.h>
#include <h/tws.h>
#include <h/fmt_compile.h>
+#include <ctype.h>
+#include <sysexits.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# include <wchar.h>
#endif
-extern char *formataddr(); /* hook for custom address formatting */
-
extern int fmt_norm; /* defined in sbr/fmt_def.c = AD_NAME */
struct mailname fmt_mnull;
cptrimmed(&cp, str, fmt->f_width, fmt->f_fill, ep - cp);
break;
case FT_STRFW:
- adios(NULL, "internal error (FT_STRFW)");
+ adios(EX_SOFTWARE, NULL, "internal error (FT_STRFW)");
case FT_NUM:
n = snprintf(cp, ep - cp + 1, "%d", value);
value = fmt->f_comp->c_tws->tw_flags & TW_DST;
break;
case FT_LS_822DATE:
- str = dasctime(fmt->f_comp->c_tws , TW_ZONE);
- break;
case FT_LS_PRETTY:
- str = dasctime(fmt->f_comp->c_tws, TW_NULL);
+ str = dasctime(fmt->f_comp->c_tws);
break;
case FT_LS_PERS:
} else
str = mn->m_text;
break;
- }
+ }
}
}
break;
sp = fmt->f_text;
indent = strlen(sp);
wid -= indent;
+ if (wid <= 0) {
+ adios(EX_SOFTWARE, NULL, "putaddr -- num register (%d) "
+ "must be greater than label "
+ "width (%d)", value, indent);
+ }
while( (c = *sp++) && cp < ep)
*cp++ = c;
while (len > wid) {
- /* try to break at a comma; failing that,
- * break at a space.
- */
+ /*
+ ** try to break at a comma; failing that,
+ ** break at a space.
+ */
lastb = 0; sp = lp + wid;
while (sp > lp && (c = *--sp) != ',') {
if (! lastb && isspace(c))