diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2017-12-10 13:36:41 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2017-12-10 13:36:41 +0100 |
commit | dd00baa7ecde11cd7a6858203ee372db3b6dea60 (patch) | |
tree | 7f8701d73676f947d60341bf7c4c70d53de02537 /sfeed_opml_import.c | |
parent | 7d1a09873ed080ad438adf4ad4d2800f93cc0271 (diff) |
sfeed_opml_import/sfeed_opml_export: allow " and \ in fields
make sure to escape them.
Diffstat (limited to 'sfeed_opml_import.c')
-rw-r--r-- | sfeed_opml_import.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sfeed_opml_import.c b/sfeed_opml_import.c index fdee71a..46aed03 100644 --- a/sfeed_opml_import.c +++ b/sfeed_opml_import.c @@ -16,9 +16,13 @@ static char url[2048], text[256], title[256]; static void printsafe(const char *s) { - for (; *s; s++) - if (!iscntrl((int)*s) && *s != '\'' && *s != '\\') - putchar((int)*s); + for (; *s; s++) { + if (iscntrl((int)*s)) + continue; + if (*s == '\\' || *s == '\'') + putchar('\\'); + putchar((int)*s); + } } static void |