Skip to content

Commit 23ac626

Browse files
authored
Support for non null-terminated string views (vincentlaucsb#248)
1 parent 4d4319c commit 23ac626

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

include/internal/csv_utility.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace csv {
1212
* @snippet tests/test_read_csv.cpp Parse Example
1313
*/
1414
CSV_INLINE CSVReader parse(csv::string_view in, CSVFormat format) {
15-
std::stringstream stream(in.data());
15+
std::stringstream stream(std::string(in.data(), in.length()));
1616
return CSVReader(stream, format);
1717
}
1818

single_include/csv.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8515,7 +8515,7 @@ namespace csv {
85158515
* @snippet tests/test_read_csv.cpp Parse Example
85168516
*/
85178517
CSV_INLINE CSVReader parse(csv::string_view in, CSVFormat format) {
8518-
std::stringstream stream(in.data());
8518+
std::stringstream stream(std::string(in.data(), in.length()));
85198519
return CSVReader(stream, format);
85208520
}
85218521

single_include_test/csv.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8515,7 +8515,7 @@ namespace csv {
85158515
* @snippet tests/test_read_csv.cpp Parse Example
85168516
*/
85178517
CSV_INLINE CSVReader parse(csv::string_view in, CSVFormat format) {
8518-
std::stringstream stream(in.data());
8518+
std::stringstream stream(std::string(in.data(), in.length()));
85198519
return CSVReader(stream, format);
85208520
}
85218521

0 commit comments

Comments
 (0)