Branch: Tag:

2009-07-12

2009-07-12 11:48:23 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Workaround for a sprintf bug in glibc-2.9_p20081201-r2 with fortify on IA64.

Rev: src/operators.c:1.249

2:   || 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: operators.c,v 1.248 2009/06/30 21:39:51 mast Exp $ + || $Id: operators.c,v 1.249 2009/07/12 11:48:23 grubba Exp $   */      #include "global.h"
481:    return;       case T_FLOAT: +  if (sp[-1].u.float_number < 0) { +  /* Some libc's have bugs in the handling of large negative floats... */ +  sprintf(buf,"-%.*"PRINTPIKEFLOAT"g", +  MAX_FLOAT_PREC_LEN, -sp[-1].u.float_number); +  } else {    sprintf(buf,"%.*"PRINTPIKEFLOAT"g",    MAX_FLOAT_PREC_LEN, sp[-1].u.float_number); -  +  }    /* Ensure that either an exponent or a decimal point gets printed,    * since %g can remove both which would make it look like an integer. */    if (!strchr (buf, '.') && !strchr (buf, 'e'))