From 79a60aa3a9cb8a9e44077937fb1ad6e876eac83a Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 20 Jan 2013 20:29:03 +0000 Subject: Properly handle "%%" and "%N" where N is not a supported escape. This is consistent with strftime(3) behavior. OK stsp@ --- lib/libc/time/wcsftime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/libc/time') diff --git a/lib/libc/time/wcsftime.c b/lib/libc/time/wcsftime.c index ed0db3525d1..5760493a3a2 100644 --- a/lib/libc/time/wcsftime.c +++ b/lib/libc/time/wcsftime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcsftime.c,v 1.1 2011/10/10 14:40:25 espie Exp $ */ +/* $OpenBSD: wcsftime.c,v 1.2 2013/01/20 20:29:02 millert Exp $ */ #include "private.h" /* @@ -505,6 +505,8 @@ label: ** character itself as printf(3) also does. */ default: + if (pt != ptlim) + *pt++ = *format; break; } } -- cgit v1.2.3