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. */
@ -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;
}