/*
- * $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
*/
*/
long unescape_input(char *buf)
{
- int a, b;
+ unsigned int a, b;
char hex[3];
long buflen;
long len;
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)
*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) ){
}
-void escputs1(char *strbuf, int nbsp, int nolinebreaks)
+void escputs1(const char *strbuf, int nbsp, int nolinebreaks)
{
StrEscAppend(WC->WBuf, NULL, strbuf, nbsp, nolinebreaks);
}
/*
* static wrapper for ecsputs1
*/
-void escputs(char *strbuf)
+void escputs(const char *strbuf)
{
escputs1(strbuf, 0, 0);
}
char outbuf[SIZ];
jsesc(outbuf, SIZ, strbuf);
- wprintf("%s", outbuf);
+ wc_printf("%s", outbuf);
}
/*