projects
/
sbcl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a5ca77
)
LLP64: replace use of unsigned long with size_t in parse_size_arg
author
David Lichteblau
<david@lichteblau.com>
Mon, 12 Nov 2012 16:33:47 +0000
(17:33 +0100)
committer
David Lichteblau
<david@lichteblau.com>
Fri, 23 Nov 2012 14:06:20 +0000
(15:06 +0100)
Thanks to Anton Kovalenko.
src/runtime/runtime.c
patch
|
blob
|
history
diff --git
a/src/runtime/runtime.c
b/src/runtime/runtime.c
index
2478239
..
63bc99c
100644
(file)
--- a/
src/runtime/runtime.c
+++ b/
src/runtime/runtime.c
@@
-294,10
+294,11
@@
search_for_executable(const char *argv0)
}
#endif /* LISP_FEATURE_WIN32 */
-unsigned long parse_size_arg(char *arg, char *arg_name)
+size_t
+parse_size_arg(char *arg, char *arg_name)
{
char *tail, *power_name;
- unsigned long power, res;
+ size_t power, res;
res = strtoul(arg, &tail, 0);
@@
-329,7
+330,7
@@
unsigned long parse_size_arg(char *arg, char *arg_name)
free(power_name);
}
if ((res <= 0) ||
- (res > (ULONG_MAX >> power))) {
+ (res >= (SIZE_MAX >> power))) {
lose("%s argument is out of range: %s", arg_name, arg);
}
res <<= power;