X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=libcitadel%2Flib%2Ftools.c;h=da37f7f080673977a96a77d0e6a5a5769e7d5ce5;hb=c868229ed7f01d77d31cf062e4c90b330f855052;hp=0166f0b706df1f502737a0efa24e2239af756c2d;hpb=5b6e73afc7dafc549bb179b6610689b1be64322e;p=citadel.git diff --git a/libcitadel/lib/tools.c b/libcitadel/lib/tools.c index 0166f0b70..da37f7f08 100644 --- a/libcitadel/lib/tools.c +++ b/libcitadel/lib/tools.c @@ -996,3 +996,20 @@ void convert_spaces_to_underscores(char *str) } +/* + * check whether the provided string needs to be qp encoded or not + */ +int CheckEncode(const char *pch, long len, const char *pche) +{ + if (pche == NULL) + pche = pch + len; + while (pch < pche) { + if (((unsigned char) *pch < 32) || + ((unsigned char) *pch > 126)) { + return 1; + } + pch++; + } + return 0; +} +