Fix csv_escape #58

This commit is contained in:
2020-06-05 19:13:03 -04:00
parent 27b4e6403e
commit 018b49fa4c
4 changed files with 8 additions and 6 deletions

View File

@@ -188,9 +188,9 @@ void csv_escape(char *dst, const char *str) {
return;
}
while (*ptr++ != 0) {
char c = *ptr;
*out++ = '"';
char c;
while ((c = *ptr++) != 0) {
if (c == '"') {
*out++ = '"';
*out++ = '"';
@@ -198,6 +198,8 @@ void csv_escape(char *dst, const char *str) {
*out++ = c;
}
}
*out++ = '"';
*out = '\0';
}
int open_or_exit(const char *path) {