Module Name:    src
Committed By:   rillig
Date:           Fri Mar 25 19:34:04 UTC 2022

Modified Files:
        src/lib/libc/time: localtime.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/lib/libc/time/localtime.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/localtime.c
diff -u src/lib/libc/time/localtime.c:1.132 src/lib/libc/time/localtime.c:1.133
--- src/lib/libc/time/localtime.c:1.132	Fri Mar 25 19:25:23 2022
+++ src/lib/libc/time/localtime.c	Fri Mar 25 19:34:04 2022
@@ -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;
 }
 

Reply via email to