mirror of
https://github.com/tailix/libkernaux.git
synced 2024-11-13 11:04:27 -05:00
Ruby: Remove snprintf1 format length validation
This commit is contained in:
parent
6fe0254dce
commit
177e6d3a1c
2 changed files with 0 additions and 17 deletions
|
@ -129,7 +129,6 @@ VALUE rb_KernAux_snprintf1(
|
||||||
const char *const format = StringValueCStr(format_rb);
|
const char *const format = StringValueCStr(format_rb);
|
||||||
|
|
||||||
if (size < 0) rb_raise(rb_eRangeError, "expected non-negative size");
|
if (size < 0) rb_raise(rb_eRangeError, "expected non-negative size");
|
||||||
if (strlen(format) > 100) rb_raise(rb_eArgError, "invalid format");
|
|
||||||
|
|
||||||
const char *fmt = format;
|
const char *fmt = format;
|
||||||
|
|
||||||
|
|
|
@ -47,14 +47,6 @@ RSpec.describe KernAux, '.snprintf1' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when format is too long' do
|
|
||||||
let(:format) { "%s#{' ' * 99}" }
|
|
||||||
|
|
||||||
specify do
|
|
||||||
expect { snprintf1 }.to raise_error ArgumentError, 'invalid format'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when format doesn\'t include "%" char' do
|
context 'when format doesn\'t include "%" char' do
|
||||||
let(:format) { 'foo' }
|
let(:format) { 'foo' }
|
||||||
|
|
||||||
|
@ -115,14 +107,6 @@ RSpec.describe KernAux, '.snprintf1' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when format is too long' do
|
|
||||||
let(:format) { "%s#{' ' * 99}" }
|
|
||||||
|
|
||||||
specify do
|
|
||||||
expect { snprintf1 }.to raise_error ArgumentError, 'invalid format'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'when format doesn\'t include "%" char' do
|
context 'when format doesn\'t include "%" char' do
|
||||||
let(:format) { 'foo' }
|
let(:format) { 'foo' }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue