Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/time localtime.c: fix theoretical syntax error



details:   https://anonhg.NetBSD.org/src/rev/6a4b4195a687
branches:  trunk
changeset: 364447:6a4b4195a687
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Mar 25 19:34:04 2022 +0000

description:
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.

diffstat:

 lib/libc/time/localtime.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (31 lines):

diff -r 24f09980b629 -r 6a4b4195a687 lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Fri Mar 25 19:25:23 2022 +0000
+++ b/lib/libc/time/localtime.c Fri Mar 25 19:34:04 2022 +0000
@@ -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 @@
       errno = err;
       return NULL;
     }
-  }
-#if !HAVE_MALLOC_ERRNO
-  } else
+  } else if (!HAVE_MALLOC_ERRNO)
     errno = ENOMEM;
-#endif
   return sp;
 }
 



Home | Main Index | Thread Index | Old Index