summaryrefslogtreecommitdiff
path: root/Src/watch.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/watch.c')
-rw-r--r--Src/watch.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Src/watch.c b/Src/watch.c
index fe409f91a..c804913ad 100644
--- a/Src/watch.c
+++ b/Src/watch.c
@@ -237,6 +237,7 @@ watchlog2(int inout, WATCH_STRUCT_UTMP *u, char *fmt, int prnt, int fini)
time_t timet;
struct tm *tm;
char *fm2;
+ int len;
# ifdef WATCH_UTMP_UT_HOST
char *p;
int i;
@@ -330,7 +331,9 @@ watchlog2(int inout, WATCH_STRUCT_UTMP *u, char *fmt, int prnt, int fini)
}
timet = getlogtime(u, inout);
tm = localtime(&timet);
- ztrftime(buf, 40, fm2, tm, 0L);
+ len = ztrftime(buf, 40, fm2, tm, 0L);
+ if (len > 0)
+ metafy(buf, len, META_NOALLOC);
printf("%s", (*buf == ' ') ? buf + 1 : buf);
break;
case '%':
@@ -566,7 +569,7 @@ dowatch(void)
return;
}
queue_signals();
- if (!(fmt = getsparam("WATCHFMT")))
+ if (!(fmt = getsparam_u("WATCHFMT")))
fmt = DEFAULT_WATCHFMT;
while ((uct || wct) && !errflag)
if (!uct || (wct && ucmp(uptr, wptr) > 0))