1
0
Fork 0
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:
Alex Kotov 2022-01-21 19:25:52 +05:00
parent 6fe0254dce
commit 177e6d3a1c
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 0 additions and 17 deletions

View file

@ -129,7 +129,6 @@ VALUE rb_KernAux_snprintf1(
const char *const format = StringValueCStr(format_rb);
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;

View file

@ -47,14 +47,6 @@ RSpec.describe KernAux, '.snprintf1' do
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
let(:format) { 'foo' }
@ -115,14 +107,6 @@ RSpec.describe KernAux, '.snprintf1' do
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
let(:format) { 'foo' }