commit 07692ff2b49ab52c4ae4635891b248ff5cde6ae2
parent 68b45f1535f40d6f894e2443f6f3ccdbf365696e
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 8 Apr 2014 14:51:51 +0200
sfeed_frames: fix escaped string
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
Diffstat:
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git 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++;
}
}
}