Skip to content
Merged

misc #172

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ end

desc "Run test"
task :test do
require 'shellwords'
ENV["RUBYOPT"] = "-I#{extra_require_path} -rbundler/setup"
ruby("run-test.rb")
ruby("run-test.rb", *ENV["TESTOPTS"]&.shellsplit)
end

desc "Run benchmark"
Expand Down
8 changes: 4 additions & 4 deletions ext/strscan/strscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ static VALUE
strscan_scan_base10_integer(VALUE self)
{
char *ptr;
long len = 0;
long len = 0, remaining_len;
struct strscanner *p;

GET_SCANNER(self, p);
Expand All @@ -1284,7 +1284,7 @@ strscan_scan_base10_integer(VALUE self)

ptr = CURPTR(p);

long remaining_len = S_RESTLEN(p);
remaining_len = S_RESTLEN(p);

if (remaining_len <= 0) {
return Qnil;
Expand All @@ -1311,7 +1311,7 @@ static VALUE
strscan_scan_base16_integer(VALUE self)
{
char *ptr;
long len = 0;
long len = 0, remaining_len;
struct strscanner *p;

GET_SCANNER(self, p);
Expand All @@ -1321,7 +1321,7 @@ strscan_scan_base16_integer(VALUE self)

ptr = CURPTR(p);

long remaining_len = S_RESTLEN(p);
remaining_len = S_RESTLEN(p);

if (remaining_len <= 0) {
return Qnil;
Expand Down