-multiply infinity without warning
authorChristian Grothoff <christian@grothoff.org>
Thu, 14 Nov 2013 12:43:55 +0000 (12:43 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 14 Nov 2013 12:43:55 +0000 (12:43 +0000)
src/util/time.c

index 19f3e488f402780573df110bd66935011f8ed356..a615756280b803db0a4925edf6341e9a73de0742 100644 (file)
@@ -385,6 +385,8 @@ GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel,
 
   if (0 == factor)
     return GNUNET_TIME_UNIT_ZERO;
+  if (rel.rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us)
+    return GNUNET_TIME_UNIT_FOREVER_REL;
   ret.rel_value_us = rel.rel_value_us * (unsigned long long) factor;
   if (ret.rel_value_us / factor != rel.rel_value_us)
   {