summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2007-06-16 22:52:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:23:25 -0500
commit9dcbef9615aec7cfe8f72e6f21f01af4e4fcc90e (patch)
tree4977cc4c0d3aebb09a0355140c3ab210d56ef07f /source
parent3635b304155299ac93fda57e5e9ece0acd605e77 (diff)
downloadsamba-9dcbef9615aec7cfe8f72e6f21f01af4e4fcc90e.tar.gz
samba-9dcbef9615aec7cfe8f72e6f21f01af4e4fcc90e.tar.xz
samba-9dcbef9615aec7cfe8f72e6f21f01af4e4fcc90e.zip
r23527: Use existing escaping function pointed by James
Diffstat (limited to 'source')
-rw-r--r--source/client/smbspool.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/source/client/smbspool.c b/source/client/smbspool.c
index 89863cc0ff2..a4681e9f615 100644
--- a/source/client/smbspool.c
+++ b/source/client/smbspool.c
@@ -603,35 +603,11 @@ smb_print(struct cli_state *cli, /* I - SMB connection */
static char *uri_unescape_alloc(const char *uritok)
{
- char *t, *ret;
- const char *p;
- long int val;
- char eval[3];
-
- ret = (char *)SMB_MALLOC(strlen(uritok)+1);
+ char *ret;
+ ret = (char *)SMB_STRDUP(uritok);
if (!ret) return NULL;
- eval[2] = '\0';
-
- for (p = uritok, t = ret; *p; p++, t++) {
- if (*p == '%') { /* unescape hex */
- p++;
- eval[0] = *p;
- p++;
- eval[1] = *p;
- val = strtol(eval, NULL, 16);
- if ((val == LONG_MIN || val == LONG_MAX) && errno == ERANGE) {
- SAFE_FREE(ret);
- return NULL;
- }
- *t = (char)val;
- } else {
- *t = *p;
- }
- }
-
- *t = '\0'; /*terminate*/
-
+ rfc1738_unescape(ret);
return ret;
}