Branch: Tag:

2004-10-15

2004-10-15 15:36:51 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed warning.

Rev: src/builtin_functions.c:1.571
Rev: src/encode.c:1.220
Rev: src/modules/_Image_XFace/image_xface.c:1.23
Rev: src/modules/files/efuns.c:1.149
Rev: src/modules/files/file.c:1.331
Rev: src/post_modules/Bz2/libbzip2mod.cmod:1.17
Rev: src/svalue.c:1.202

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: builtin_functions.c,v 1.570 2004/10/13 23:56:17 nilsson Exp $ + || $Id: builtin_functions.c,v 1.571 2004/10/15 15:36:04 grubba Exp $   */      #include "global.h"
3080:    (array_fix_type_field(to) & ~BIT_STRING) )    Pike_error("replace: to array not array(string).\n");    -  if( from->size > (LONG_MAX/sizeof(struct tupel)) ) -  Pike_error("Array too large (size %ld exceeds %ld).\n", -  (long)from->size, (long)(LONG_MAX/sizeof(struct tupel))); +  /* NOTE: The following test is needed, since sizeof(struct tupel) +  * is somewhat greater than sizeof(struct svalue). +  */ +  if (from->size > (ptrdiff_t)(LONG_MAX/sizeof(struct tupel))) +  Pike_error("Array too large (size %" PRINTPTRDIFFT "d " +  "exceeds %" PRINTSIZET "d).\n", +  from->size, (LONG_MAX/sizeof(struct tupel)));    ctx.v=(struct tupel *)xalloc(sizeof(struct tupel)*from->size);    init_string_builder(&ctx.ret,str->size_shift);    SET_ONERROR (uwp, free_replace_many_context, &ctx);