mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
- Fixed Bug #35978 %n format string specifier wrongly implemented
This commit is contained in:
parent
0e42375ded
commit
a372669d4a
2 changed files with 4 additions and 2 deletions
|
@ -1015,7 +1015,7 @@ static int format_converter(register buffy * odp, const char *fmt,
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
*(va_arg(ap, int *)) = cc;
|
*(va_arg(ap, int *)) = cc;
|
||||||
break;
|
goto skip_output;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Always extract the argument as a "char *" pointer. We
|
* Always extract the argument as a "char *" pointer. We
|
||||||
|
@ -1096,6 +1096,7 @@ fmt_error:
|
||||||
if (adjust_width && adjust == LEFT && min_width > s_len)
|
if (adjust_width && adjust == LEFT && min_width > s_len)
|
||||||
PAD(min_width, s_len, pad_char);
|
PAD(min_width, s_len, pad_char);
|
||||||
}
|
}
|
||||||
|
skip_output:
|
||||||
fmt++;
|
fmt++;
|
||||||
}
|
}
|
||||||
odp->nextb = sp;
|
odp->nextb = sp;
|
||||||
|
|
|
@ -722,7 +722,7 @@ fmt_string:
|
||||||
|
|
||||||
case 'n':
|
case 'n':
|
||||||
*(va_arg(ap, int *)) = xbuf->len;
|
*(va_arg(ap, int *)) = xbuf->len;
|
||||||
break;
|
goto skip_output;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Always extract the argument as a "char *" pointer. We
|
* Always extract the argument as a "char *" pointer. We
|
||||||
|
@ -802,6 +802,7 @@ fmt_error:
|
||||||
PAD(unicode, xbuf, min_width - s_len, pad_char);
|
PAD(unicode, xbuf, min_width - s_len, pad_char);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
skip_output:
|
||||||
fmt++;
|
fmt++;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue