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.174 2004/11/06 13:41:38 grubba Exp $ + || $Id: stralloc.c,v 1.175 2004/11/06 13:52:18 grubba 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:2262:    }   }      PMOD_EXPORT void string_builder_vsprintf(struct string_builder *s,    const char *fmt,    va_list args)   {    while (*fmt) {    if (*fmt == '%') {    fmt++; -  switch (*fmt) { +  while (1) { +  switch (*(fmt++)) {    case '%':    string_builder_putchar(s, '%');    break;    case 'O':    {    dynamic_buffer old_buf;    init_buf(&old_buf);    describe_svalue(va_arg(args, struct svalue *), 0, NULL);    string_builder_binary_strcat(s, pike_global_buffer.s.str,    pike_global_buffer.s.len);
pike.git/src/stralloc.c:2306:    string_builder_append_integer(s, va_arg(args, unsigned int), 16, 0);    break;    case 'X':    string_builder_append_integer(s, va_arg(args, unsigned int), 16,    APPEND_UPPER_CASE);    break;    case 'u':    string_builder_append_integer(s, va_arg(args, unsigned int), 10, 0);    break;    case 'd': -  string_builder_append_integer(s, va_arg(args, int), 10, APPEND_SIGNED); +  string_builder_append_integer(s, va_arg(args, int), 10, +  APPEND_SIGNED);    break;    default:    Pike_fatal("string_builder_vsprintf(): Invalid formatting method: " -  "'%c' 0x%x.\n", *fmt, *fmt); +  "'%c' 0x%x.\n", fmt[-1], fmt[-1]);    } -  fmt++; +  break; +  }    } else {    const char *start = fmt;    while (*fmt && (*fmt != '%'))    fmt++;    string_builder_binary_strcat(s, start, fmt-start);    }    }   }      PMOD_EXPORT void string_builder_sprintf(struct string_builder *s,