forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd2b0b60
committed
Improve our response to invalid format strings, and detect more cases.
Places that are testing for *printf failure ought to include the formatstring in their error reports, since bad-format-string is one of themore likely causes of such failure. This both makes it easier to findand repair the mistake, and provides at least some useful info to theuser who stumbles across such a problem.Also, tighten snprintf.c to report EINVAL for an invalid flag orfinal character in a format %-spec (including the case where the%-spec is missing a final character altogether). This seems likebetter project policy, and it also allows removing an instructionor two from the hot code path.Back-patch the error reporting change in pvsnprintf, since it should beharmless and may be helpful; but not the snprintf.c change.Per discussion of bug #15511 from Ertuğrul Kahveci, which reported aninvalid translated format string. These changes don't fix that error,but they should improve matters next time we make such a mistake.Discussion:https://postgr.es/m/15511-1d8b6a0bc874112f@postgresql.org1 parent7a55ccc commitd2b0b60
3 files changed
+13
-8
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4387 | 4387 |
| |
4388 | 4388 |
| |
4389 | 4389 |
| |
4390 |
| - | |
| 4390 | + | |
4391 | 4391 |
| |
4392 | 4392 |
| |
4393 | 4393 |
| |
| |||
9666 | 9666 |
| |
9667 | 9667 |
| |
9668 | 9668 |
| |
9669 |
| - | |
| 9669 | + | |
9670 | 9670 |
| |
9671 | 9671 |
| |
9672 | 9672 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
113 | 113 |
| |
114 | 114 |
| |
115 | 115 |
| |
116 |
| - | |
| 116 | + | |
117 | 117 |
| |
118 |
| - | |
| 118 | + | |
119 | 119 |
| |
120 | 120 |
| |
121 | 121 |
| |
|
Lines changed: 9 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
452 | 452 |
| |
453 | 453 |
| |
454 | 454 |
| |
455 |
| - | |
456 |
| - | |
457 | 455 |
| |
458 | 456 |
| |
459 | 457 |
| |
| |||
718 | 716 |
| |
719 | 717 |
| |
720 | 718 |
| |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
721 | 726 |
| |
722 | 727 |
| |
723 | 728 |
| |
| |||
782 | 787 |
| |
783 | 788 |
| |
784 | 789 |
| |
785 |
| - | |
786 |
| - | |
787 | 790 |
| |
788 | 791 |
| |
789 | 792 |
| |
| |||
918 | 921 |
| |
919 | 922 |
| |
920 | 923 |
| |
| 924 | + | |
| 925 | + | |
921 | 926 |
| |
922 | 927 |
| |
923 | 928 |
| |
|
0 commit comments
Comments
(0)