summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2011-04-21 21:02:04 +0200
committerPieter Noordhuis <pcnoordhuis@gmail.com>2011-04-21 21:02:04 +0200
commitebb690ea9991cb63f81b4b38b55643823e48251b (patch)
tree3b16aa83cf341a2fcfcd9de73929a0d5f9daff44
parentdd5fc26457017aaf6981a99cc07c04df2a8fe3c2 (diff)
Fix sdscatrepr
-rw-r--r--sds.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sds.c b/sds.c
index 02fb443..0af9c67 100644
--- a/sds.c
+++ b/sds.c
@@ -386,11 +386,11 @@ sds sdscatrepr(sds s, char *p, size_t len) {
case '"':
s = sdscatprintf(s,"\\%c",*p);
break;
- case '\n': s = sdscatlen(s,"\\n",1); break;
- case '\r': s = sdscatlen(s,"\\r",1); break;
- case '\t': s = sdscatlen(s,"\\t",1); break;
- case '\a': s = sdscatlen(s,"\\a",1); break;
- case '\b': s = sdscatlen(s,"\\b",1); break;
+ case '\n': s = sdscatlen(s,"\\n",2); break;
+ case '\r': s = sdscatlen(s,"\\r",2); break;
+ case '\t': s = sdscatlen(s,"\\t",2); break;
+ case '\a': s = sdscatlen(s,"\\a",2); break;
+ case '\b': s = sdscatlen(s,"\\b",2); break;
default:
if (isprint(*p))
s = sdscatprintf(s,"%c",*p);