Nettoyages. Ajout formats %lx %nx %Lx

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3930 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 2001-10-28 14:19:13 +00:00
parent bdaacc1d30
commit c290d4a3ba
1 changed files with 3 additions and 1 deletions

View File

@ -100,11 +100,13 @@ static char * parse_format(value fmt,
memmove(format_string, String_val(fmt), len);
p = format_string + len - 1;
lastletter = *p;
/* Compress two-letter formats, ignoring the [lnL] annotation */
if (p[-1] == 'l' || p[-1] == 'n' || p[-1] == 'L') p--;
memmove(p, suffix, len_suffix); p += len_suffix;
*p++ = lastletter;
*p = 0;
/* Determine space needed for result and allocate it dynamically if needed */
prec = 32;
prec = 22 + 5; /* 22 digits for 64-bit number in octal + 5 extra */
for (p = String_val(fmt); *p != 0; p++) {
if (*p >= '0' && *p <= '9') {
prec = atoi(p) + 5;