]> code.citadel.org Git - citadel.git/blobdiff - webcit/utils.c
Remove $Id$ tags from most of webcit
[citadel.git] / webcit / utils.c
index 78b6b8c25499fd6608537ac97981f0c6bef8883c..8f19109d68906b6556a4872fee4d02c85f1e7d2e 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id: utils.c 6808 2008-12-11 00:00:36Z dothebart $
- *
  * de/encoding stuff. hopefully mostly to be depricated in favour of subst.c + strbuf
  */
 
@@ -15,7 +13,7 @@
  */
 long unescape_input(char *buf)
 {
-       int a, b;
+       unsigned int a, b;
        char hex[3];
        long buflen;
        long len;
@@ -42,7 +40,7 @@ long unescape_input(char *buf)
                                hex[1] = buf[a + 2];
                                hex[2] = 0;
                                b = 0;
-                               sscanf(hex, "%02x", &b);
+                               b = decode_hex(hex);
                                buf[a] = (char) b;
                                len = buflen - a - 2;
                                if (len > 0)
@@ -71,7 +69,7 @@ long stresc(char *target, long tSize, char *strbuf, int nbsp, int nolinebreaks)
         *target = '\0';
         aptr = strbuf;
         bptr = target;
-        eptr = target + tSize - 6; // our biggest unit to put in... 
+        eptr = target + tSize - 6; /* our biggest unit to put in...  */
  
  
         while ((bptr < eptr) && !IsEmptyStr(aptr) ){
@@ -130,7 +128,7 @@ long stresc(char *target, long tSize, char *strbuf, int nbsp, int nolinebreaks)
 }
 
 
-void escputs1(char *strbuf, int nbsp, int nolinebreaks)
+void escputs1(const char *strbuf, int nbsp, int nolinebreaks)
 {
        StrEscAppend(WC->WBuf, NULL, strbuf, nbsp, nolinebreaks);
 }
@@ -143,7 +141,7 @@ void StrEscputs1(const StrBuf *strbuf, int nbsp, int nolinebreaks)
 /* 
  * static wrapper for ecsputs1
  */
-void escputs(char *strbuf)
+void escputs(const char *strbuf)
 {
        escputs1(strbuf, 0, 0);
 }
@@ -249,7 +247,7 @@ void jsescputs(char *strbuf)
        char outbuf[SIZ];
        
        jsesc(outbuf, SIZ, strbuf);
-       wprintf("%s", outbuf);
+       wc_printf("%s", outbuf);
 }
 
 /*