summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfeed_atom.c2
-rw-r--r--sfeed_json.c2
-rw-r--r--sfeed_mbox.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/sfeed_atom.c b/sfeed_atom.c
index aeea2de..ace7d5a 100644
--- a/sfeed_atom.c
+++ b/sfeed_atom.c
@@ -22,6 +22,8 @@ printcontent(const char *s)
case '&': fputs("&", stdout); break;
case '"': fputs(""", stdout); break;
case '\\':
+ if (*(s + 1) == '\0')
+ break;
s++;
switch (*s) {
case 'n': putchar('\n'); break;
diff --git a/sfeed_json.c b/sfeed_json.c
index f6bb904..e177d2b 100644
--- a/sfeed_json.c
+++ b/sfeed_json.c
@@ -16,6 +16,8 @@ printcontent(const char *s)
for (; *s; s++) {
switch (*s) {
case '\\':
+ if (*(s + 1) == '\0')
+ break;
s++;
switch (*s) {
case 'n': fputs("\\n", stdout); break;
diff --git a/sfeed_mbox.c b/sfeed_mbox.c
index b5e7e3d..c00971f 100644
--- a/sfeed_mbox.c
+++ b/sfeed_mbox.c
@@ -37,6 +37,8 @@ escapefrom:
for (; *s; s++) {
switch (*s) {
case '\\':
+ if (*(s + 1) == '\0')
+ break;
s++;
switch (*s) {
case 'n':