Skip to content

Commit 0dddba3

Browse files
Fix cfg for std::xstream::write() (#4778)
1 parent 271ccbc commit 0dddba3

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

cfg/std.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6539,7 +6539,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
65396539
</arg>
65406540
<arg nr="2" direction="in">
65416541
<not-uninit/>
6542-
<valid>1:</valid>
6542+
<valid>0:</valid>
65436543
</arg>
65446544
</function>
65456545
<!--std::ostringstream& std::ostringstream::write (const char* s, streamsize n);-->
@@ -6554,7 +6554,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
65546554
</arg>
65556555
<arg nr="2" direction="in">
65566556
<not-uninit/>
6557-
<valid>1:</valid>
6557+
<valid>0:</valid>
65586558
</arg>
65596559
</function>
65606560
<!--std::ostream& std::ostream::write (const char* s, streamsize n);-->
@@ -6569,7 +6569,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
65696569
</arg>
65706570
<arg nr="2" direction="in">
65716571
<not-uninit/>
6572-
<valid>1:</valid>
6572+
<valid>0:</valid>
65736573
</arg>
65746574
</function>
65756575
<!--std::fstream& std::fstream::write (const char* s, streamsize n);-->
@@ -6584,7 +6584,7 @@ The obsolete function 'gets' is called. With 'gets' you'll get a buffer overrun
65846584
</arg>
65856585
<arg nr="2" direction="in">
65866586
<not-uninit/>
6587-
<valid>1:</valid>
6587+
<valid>0:</valid>
65886588
</arg>
65896589
</function>
65906590
<!-- void std::vector::assign( size_type count, const T& value ); -->

test/cfg/std.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4458,6 +4458,11 @@ void getline()
44584458
in.close();
44594459
}
44604460

4461+
void stream_write(std::ofstream& s, std::vector<char> v) {
4462+
if (v.empty()) {}
4463+
s.write(v.data(), v.size());
4464+
}
4465+
44614466
void stdstring()
44624467
{
44634468
std::string s;

0 commit comments

Comments
 (0)