]> code.citadel.org Git - citadel.git/blobdiff - libcitadel/lib/tools.c
make it const, baby!
[citadel.git] / libcitadel / lib / tools.c
index f520ee2d96b5365d2876a8385fbd50b6788672cb..2eafddaaaa4e602d865c1052581f23eb299a0f61 100644 (file)
@@ -445,9 +445,9 @@ int CtdlDecodeBase64(char *dest, const char *source, size_t length)
 /*
  * if we send out non ascii subjects, we encode it this way.
  */
-char *rfc2047encode(char *line, long length)
+char *rfc2047encode(const char *line, long length)
 {
-       char *AlreadyEncoded;
+       const char *AlreadyEncoded;
        char *result;
        long end;
 #define UTF8_HEADER "=?UTF-8?B?"
@@ -573,7 +573,7 @@ void fmt_date(char *buf, size_t n, time_t thetime, int seconds) {
                "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
        };
 
-       strcpy(buf, "");
+       *buf = '\0';
        localtime_r(&thetime, &tm);
 
        hour = tm.tm_hour;
@@ -835,7 +835,7 @@ void urlesc(char *outbuf, size_t oblen, char *strbuf)
        int a, b, c, len, eclen, olen;
        char *ec = " +#&;`'|*?-~<>^()[]{}/$\"\\";
 
-       strcpy(outbuf, "");
+       *outbuf = '\0';
        len = strlen(strbuf);
        eclen = strlen(ec);
        olen = 0;