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.
This commit is contained in:
rillig 2022-03-25 19:34:04 +00:00
parent c87b5bf8e3
commit 8d3736f16d
1 changed files with 3 additions and 6 deletions

View File

@ -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. */ /* Convert timestamp from time_t to struct tm. */
@ -12,7 +12,7 @@
#if 0 #if 0
static char elsieid[] = "@(#)localtime.c 8.17"; static char elsieid[] = "@(#)localtime.c 8.17";
#else #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
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
@ -1555,11 +1555,8 @@ tzalloc(char const *name)
errno = err; errno = err;
return NULL; return NULL;
} }
} } else if (!HAVE_MALLOC_ERRNO)
#if !HAVE_MALLOC_ERRNO
} else
errno = ENOMEM; errno = ENOMEM;
#endif
return sp; return sp;
} }