diff options
author | Simo Sorce <idra@samba.org> | 2007-06-16 22:52:51 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:25 -0500 |
commit | a0c3774ab14342e502ef567bc63fb68a5eaa25ab (patch) | |
tree | 89527688da952bf474b7144329a80f7111561b15 /source3/client/smbspool.c | |
parent | f46690c3bbc42fab5943247234b1cc8296545ec8 (diff) | |
download | samba-a0c3774ab14342e502ef567bc63fb68a5eaa25ab.tar.gz |
r23527: Use existing escaping function pointed by James
(This used to be commit 9dcbef9615aec7cfe8f72e6f21f01af4e4fcc90e)
Diffstat (limited to 'source3/client/smbspool.c')
-rw-r--r-- | source3/client/smbspool.c | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c index 89863cc0ff2..a4681e9f615 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; } |