|
Check-in Number:
|
5030 | |
| Date: |
2005-Feb-18 22:45:36 (local)
2005-Feb-18 21:45:36 (UTC) |
| User: | rse |
| Branch: | |
| Comment: |
Fix internal determination of maximum number in a size_t in
the string formatter engine. |
| Tickets: |
|
| Inspections: |
|
| Files: |
|
ossp-pkg/pth/ChangeLog 1.636 -> 1.637
--- ChangeLog 2005/02/18 20:40:21 1.636
+++ ChangeLog 2005/02/18 21:45:36 1.637
@@ -21,6 +21,10 @@
Changes between 2.0.3 and 2.0.4 (03-Dec-2004 to 18-Feb-2005)
+ *) Fix internal determination of maximum number in a size_t in
+ the string formatter engine.
+ [Ralf S. Engelschall]
+
*) Upgraded build environment to GNU libtool 1.5.14
[Ralf S. Engelschall]
|
|
ossp-pkg/pth/pth_string.c 1.13 -> 1.14
--- pth_string.c 2004/12/31 19:34:45 1.13
+++ pth_string.c 2005/02/18 21:45:36 1.14
@@ -121,8 +121,8 @@
ch = *format++;
if (maxlen == -1)
- /* possible maximum size in a size_t */
- maxlen = (~(1<<((sizeof(size_t)*8)-2)));
+ /* possible maximum size in a size_t (size_t unfortunately could be signed) */
+ maxlen = (~(((size_t)1)<<((sizeof(size_t)*8)-1)));
while (state != DP_S_DONE) {
if ((ch == NUL) || (currlen >= maxlen))
|
|