pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: builtin_functions.c,v 1.547 2004/12/13 19:37:31 mast Exp $ + || $Id: builtin_functions.c,v 1.548 2004/12/14 15:04:57 mast Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.547 2004/12/13 19:37:31 mast Exp $"); + RCSID("$Id: builtin_functions.c,v 1.548 2004/12/14 15:04:57 mast Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:4437: Inside #if defined (HAVE_GMTIME) || defined (HAVE_LOCALTIME)
   * it's correct to always go forward so that e.g. April 31st    * maps to May 1st. */    if (diff_ts > 0)    current_ts += diff_ts;   #ifdef DEBUG_MY_TIME_INVERSE    fprintf (stderr, "end of month gap\n");   #endif    break;    }    +  if (INT_TYPE_ADD_OVERFLOW (current_ts, diff_ts)) { + #ifdef DEBUG_MY_TIME_INVERSE +  fprintf (stderr, "got overflow adding %ld and %ld\n", +  (long) current_ts, (long) diff_ts); + #endif +  return 0; +  }    current_ts += diff_ts;    }      #ifdef DEBUG_MY_TIME_INVERSE    fprintf (stderr, "res: y %d m %d d %d h %d m %d isdst %d\n",    current_tm->tm_year, current_tm->tm_mon, current_tm->tm_mday,    current_tm->tm_hour, current_tm->tm_min, current_tm->tm_isdst);   #endif    *result = current_ts;    return 1;