[haiku-commits] haiku: hrev49451 - src/system/libroot/posix

  • From: anevilyak@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 25 Jul 2015 03:58:44 +0200 (CEST)

hrev49451 adds 1 changeset to branch 'master'
old head: f5d564a1d395d830f5323669caeaac8228810648
new head: 410b38b5c533f55ed4cda35ef10971b6d073d781
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=410b38b5c533+%5Ef5d564a1d395

----------------------------------------------------------------------------

410b38b5c533: libroot: Fix strto{i,u}max.

- According to POSIX, these functions should map to whatever's appropriate
for the platform's intmax_t size, which in our case is a 64-bit integer.
Our (2004) implementation, however, was calling the 32-bit variations of
strto*(), leading to truncation for larger values.

[ Rene Gollent <rene@xxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision: hrev49451
Commit: 410b38b5c533f55ed4cda35ef10971b6d073d781
URL: http://cgit.haiku-os.org/haiku/commit/?id=410b38b5c533
Author: Rene Gollent <rene@xxxxxxxxxxx>
Date: Sat Jul 25 01:57:11 2015 UTC

----------------------------------------------------------------------------

1 file changed, 3 insertions(+), 5 deletions(-)
src/system/libroot/posix/inttypes.c | 8 +++-----

----------------------------------------------------------------------------

diff --git a/src/system/libroot/posix/inttypes.c
b/src/system/libroot/posix/inttypes.c
index 711c02f..2bcc018 100644
--- a/src/system/libroot/posix/inttypes.c
+++ b/src/system/libroot/posix/inttypes.c
@@ -1,4 +1,4 @@
-/*
+/*
** Copyright 2004, Axel Dörfler, axeld@xxxxxxxxxxxxxxxx. All rights reserved.
** Distributed under the terms of the Haiku License.
*/
@@ -35,15 +35,13 @@ imaxdiv(intmax_t numer, intmax_t denom)
intmax_t
strtoimax(const char *string, char **_end, int base)
{
- // ToDo: implement me properly!
- return (intmax_t)strtol(string, _end, base);
+ return (intmax_t)strtoll(string, _end, base);
}


uintmax_t
strtoumax(const char *string, char **_end, int base)
{
- // ToDo: implement me properly!
- return (intmax_t)strtoul(string, _end, base);
+ return (intmax_t)strtoull(string, _end, base);
}



Other related posts:

  • » [haiku-commits] haiku: hrev49451 - src/system/libroot/posix - anevilyak