- Notifications
You must be signed in to change notification settings - Fork5
Commited437e2
committed
Adjust comments about avoiding use of printf's %.*s.
My initial impression that glibc was measuring the precision in characters(which is what the Linux man page says it does) was incorrect. It does takethe precision to be in bytes, but it also tries to truncate the string at acharacter boundary. The bottom line remains the same: it will mess upif the string is not in the encoding it expects, so we need to avoid %.*sanytime there's a significant risk of that. Previous code changes are stillgood, but adjust the comments to reflect this knowledge. Per research byHernan Gonzalez.1 parent54cd4f0 commited437e2
File tree
6 files changed
+21
-26
lines changed- src
- backend
- parser
- tsearch
- utils/adt
- bin/psql
- interfaces
- ecpg/pgtypeslib
- libpq
6 files changed
+21
-26
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 |
| - | |
| 12 | + | |
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
| |||
178 | 178 |
| |
179 | 179 |
| |
180 | 180 |
| |
181 |
| - | |
182 |
| - | |
| 181 | + | |
| 182 | + | |
183 | 183 |
| |
184 | 184 |
| |
185 | 185 |
| |
|
Lines changed: 4 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
323 | 323 |
| |
324 | 324 |
| |
325 | 325 |
| |
326 |
| - | |
327 |
| - | |
328 |
| - | |
329 |
| - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
330 | 329 |
| |
331 | 330 |
| |
332 | 331 |
| |
|
Lines changed: 4 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
3741 | 3741 |
| |
3742 | 3742 |
| |
3743 | 3743 |
| |
3744 |
| - | |
3745 |
| - | |
3746 |
| - | |
3747 |
| - | |
3748 |
| - | |
| 3744 | + | |
| 3745 | + | |
| 3746 | + | |
3749 | 3747 |
| |
3750 | 3748 |
| |
3751 | 3749 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
255 | 255 |
| |
256 | 256 |
| |
257 | 257 |
| |
258 |
| - | |
259 |
| - | |
| 258 | + | |
| 259 | + | |
260 | 260 |
| |
261 | 261 |
| |
262 | 262 |
| |
|
Lines changed: 4 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
856 | 856 |
| |
857 | 857 |
| |
858 | 858 |
| |
859 |
| - | |
860 |
| - | |
861 |
| - | |
862 |
| - | |
863 |
| - | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
864 | 862 |
| |
865 | 863 |
| |
866 | 864 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| |||
70 | 70 |
| |
71 | 71 |
| |
72 | 72 |
| |
73 |
| - | |
74 |
| - | |
| 73 | + | |
| 74 | + | |
75 | 75 |
| |
76 | 76 |
| |
77 | 77 |
| |
|
0 commit comments
Comments
(0)