summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/client/smbspool.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index 89863cc0ff..a4681e9f61 100644
--- a/source3/client/smbspool.c
+++ b/source3/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;
}