Added asserts() to check the arguments to S_copy_little_tm_to_big_TM.
authorAndy Dougherty <doughera@lafayette.edu>
Thu, 17 Jan 2013 15:34:33 +0000 (10:34 -0500)
committerAndy Dougherty <doughera@lafayette.edu>
Thu, 17 Jan 2013 15:34:33 +0000 (10:34 -0500)
The original version just zeroed dest if src == NULL, but that code path
was never used.  (gcc -Os inlined the function and optimized the test
away anyway.)

time64.c

index 5ae5e7d..8cbfa7c 100644 (file)
--- a/time64.c
+++ b/time64.c
@@ -269,6 +269,8 @@ static int S_safe_year(Year year)
 
 
 static void S_copy_little_tm_to_big_TM(const struct tm *src, struct TM *dest) {
+    assert(src);
+    assert(dest);
 #ifdef USE_TM64
     dest->tm_sec        = src->tm_sec;
     dest->tm_min        = src->tm_min;