Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
e35c3aff
Commit
e35c3aff
authored
Sep 03, 2015
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unsigned long may be smaller than mrb_int; use uint64_t instead; fix #2935
parent
3a462fe4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
mrbgems/mruby-sprintf/src/sprintf.c
mrbgems/mruby-sprintf/src/sprintf.c
+1
-1
src/string.c
src/string.c
+4
-4
No files found.
mrbgems/mruby-sprintf/src/sprintf.c
View file @
e35c3aff
...
...
@@ -73,7 +73,7 @@ mrb_fix2binstr(mrb_state *mrb, mrb_value x, int base)
{
char
buf
[
64
],
*
b
=
buf
+
sizeof
buf
;
mrb_int
num
=
mrb_fixnum
(
x
);
u
nsigned
long
val
=
(
unsigned
long
)
num
;
u
int64_t
val
=
(
uint64_t
)
num
;
char
d
;
if
(
base
!=
2
)
{
...
...
src/string.c
View file @
e35c3aff
...
...
@@ -1863,7 +1863,7 @@ mrb_cstr_to_inum(mrb_state *mrb, const char *str, int base, int badcheck)
const
char
*
p
;
char
sign
=
1
;
int
c
,
uscore
;
u
nsigned
long
n
=
0
;
u
int64_t
n
=
0
;
mrb_int
val
;
#define conv_digit(c) \
...
...
@@ -1983,9 +1983,9 @@ mrb_cstr_to_inum(mrb_state *mrb, const char *str, int base, int badcheck)
}
n
*=
base
;
n
+=
c
;
}
if
(
n
>
MRB_INT_MAX
)
{
mrb_raisef
(
mrb
,
E_ARGUMENT_ERROR
,
"string (%S) too big for integer"
,
mrb_str_new_cstr
(
mrb
,
str
));
if
(
n
>
MRB_INT_MAX
)
{
mrb_raisef
(
mrb
,
E_ARGUMENT_ERROR
,
"string (%S) too big for integer"
,
mrb_str_new_cstr
(
mrb
,
str
));
}
}
val
=
n
;
if
(
badcheck
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment