From 8d3736f16dbb35a081306cf0407bf2b7fc65d243 Mon Sep 17 00:00:00 2001 From: rillig Date: Fri, 25 Mar 2022 19:34:04 +0000 Subject: [PATCH] localtime.c: fix theoretical syntax error If NetBSD were built with -DHAVE_MALLOC_ERRNO=0, the previous code would have resulted in a compile error due to the extra '}'. Fix this by copying the upstream code. No binary change. --- lib/libc/time/localtime.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c index 974e946445e7..6b5b1fcb6e36 100644 --- a/lib/libc/time/localtime.c +++ b/lib/libc/time/localtime.c @@ -1,4 +1,4 @@ -/* $NetBSD: localtime.c,v 1.132 2022/03/25 19:25:23 rillig Exp $ */ +/* $NetBSD: localtime.c,v 1.133 2022/03/25 19:34:04 rillig Exp $ */ /* Convert timestamp from time_t to struct tm. */ @@ -12,7 +12,7 @@ #if 0 static char elsieid[] = "@(#)localtime.c 8.17"; #else -__RCSID("$NetBSD: localtime.c,v 1.132 2022/03/25 19:25:23 rillig Exp $"); +__RCSID("$NetBSD: localtime.c,v 1.133 2022/03/25 19:34:04 rillig Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -1555,11 +1555,8 @@ tzalloc(char const *name) errno = err; return NULL; } - } -#if !HAVE_MALLOC_ERRNO - } else + } else if (!HAVE_MALLOC_ERRNO) errno = ENOMEM; -#endif return sp; }