pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.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: stralloc.c,v 1.212 2007/03/29 13:38:38 marcus Exp $ + || $Id: stralloc.c,v 1.213 2007/11/11 13:18:53 nilsson Exp $   */      #include "global.h"   #include "stralloc.h"   #include "pike_macros.h"   #include "dynamic_buffer.h"   #include "pike_macros.h"   #include "pike_memory.h"   #include "pike_error.h"   #include "gc.h"
pike.git/src/stralloc.c:2883:    /* Infinity */    string_builder_strcat(s, "inf");    } else {    string_builder_strcat(s, "0.0");    }    break;    }    /* FIXME: Field lengths and precision. */    if ((bytes = SNPRINTF(NULL, 0, "%f", val))) {    p_wchar0 *p = string_builder_allocate(s, bytes, 0); -  size_t check = SNPRINTF(p, bytes+1, "%f", val); +  size_t check = SNPRINTF((char*)p, bytes+1, "%f", val);    if (check != bytes) {    Pike_fatal("string_builder_vsprintf(): snprintf(%f) is not "    "trustworthy: %"PRINTSIZET"u != %"PRINTSIZET"u\n",    val, bytes, check);    }    if (s->s->size_shift) {    /* We need to widen the string we just wrote. */    if (s->s->size_shift == 1) {    p_wchar1 *p1 = (p_wchar1 *)p;    while (bytes--) {