aboutsummaryrefslogtreecommitdiff
path: root/gcc/cobol/dts.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cobol/dts.h')
-rw-r--r--gcc/cobol/dts.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cobol/dts.h b/gcc/cobol/dts.h
index 618f649..c345dc7 100644
--- a/gcc/cobol/dts.h
+++ b/gcc/cobol/dts.h
@@ -93,12 +93,12 @@ namespace dts {
if( eoinput == NULL ) eoinput = strchr(input, '\0');
auto ncm = re.size();
cm.resize(ncm);
- regmatch_t cms[ncm];
+ std::vector <regmatch_t> cms(ncm);
- int erc = regexec( &re, input, ncm, cms, 0 );
+ int erc = regexec( &re, input, ncm, cms.data(), 0 );
if( erc != 0 ) return false;
- std::transform( cms, cms+ncm, cm.begin(),
+ std::transform( cms.begin(), cms.end(), cm.begin(),
[input]( const regmatch_t& m ) {
return csub_match( input, m );
} );