summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix von Leitner <felix-libowfat@fefe.de>2018-12-14 22:21:53 +0000
committerFelix von Leitner <felix-libowfat@fefe.de>2018-12-14 22:21:53 +0000
commit0a753734d341646ac5c64531e9b4d34d7bca1ff3 (patch)
tree8af8c5d55f447e3d497797e4680bb1a81a2a6801
parentd4adc803fe6a06658da2cd0f4af6760d13408588 (diff)
downloadlibowfat-0a753734d341646ac5c64531e9b4d34d7bca1ff3.tar.gz
libowfat-0a753734d341646ac5c64531e9b4d34d7bca1ff3.zip
be less restrictive (RFC says NUL CR and LF need to be escaped)
-rw-r--r--textcode/fmt_ldapescape2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/textcode/fmt_ldapescape2.c b/textcode/fmt_ldapescape2.c
index dfb8373..4663845 100644
--- a/textcode/fmt_ldapescape2.c
+++ b/textcode/fmt_ldapescape2.c
@@ -7,7 +7,7 @@ size_t fmt_ldapescape2(char* dest,const char* src,size_t len,const char* escapem
register const unsigned char* s=(const unsigned char*) src;
size_t written=0,i;
for (i=0; i<len; ++i) {
- if (s[i]=='\\' || s[i]<' ' || strchr(escapeme,s[i])) {
+ if (s[i]=='\\' || s[i]==0 || s[i]==10 || s[i]==13 || strchr(escapeme,s[i])) {
if (dest) {
dest[written]='\\';
dest[written+1]=fmt_tohex(s[i]>>4);