summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2014-04-08 14:51:51 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2014-04-08 14:51:51 +0200
commit07692ff2b49ab52c4ae4635891b248ff5cde6ae2 (patch)
tree92c8b4bb52a18626d9205ec5e7eae1f7178b4464
parent68b45f1535f40d6f894e2443f6f3ccdbf365696e (diff)
sfeed_frames: fix escaped string
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-rw-r--r--sfeed_frames.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sfeed_frames.c b/sfeed_frames.c
index 13e59d0..626fadf 100644
--- a/sfeed_frames.c
+++ b/sfeed_frames.c
@@ -44,23 +44,20 @@ cleanup(void) {
static void
printcontent(const char *s, FILE *fp) {
const char *p;
- int len = 0;
for(p = s; *p; p++) {
if(*p == '\\') {
p++;
if(*p == '\\')
fputc('\\', fp);
- else if(*p == 't' && len)
+ else if(*p == 't')
fputc('\t', fp);
- else if(*p == 'n' && len)
+ else if(*p == 'n')
fputc('\n', fp);
else
fputc(*p, fp); /* unknown */
- len = 0;
} else {
fputc(*p, fp);
- len++;
}
}
}