Branch: Tag:

2004-11-06

2004-11-06 13:52:18 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Preparations for parsing of conversion specifiers in string_builder_vsprintf().

Rev: src/stralloc.c:1.175

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: 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"
2269:    while (*fmt) {    if (*fmt == '%') {    fmt++; -  switch (*fmt) { +  while (1) { +  switch (*(fmt++)) {    case '%':    string_builder_putchar(s, '%');    break;
2313:    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 != '%'))