summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2018-02-17 10:46:44 +1300
committerDouglas Bagnall <dbagnall@samba.org>2018-02-22 01:04:18 +0100
commita4c853a7deb080dd44e3c54eb45935ff0df91baf (patch)
treea0c343ff4c1485f0fedb844f958529f56d1cc6dc /lib
parent6ef6ddce5a64c55729c2e3d423757f504b0ab15e (diff)
downloadsamba-a4c853a7deb080dd44e3c54eb45935ff0df91baf.tar.gz
util/rfc1738_unescape(): return end pointer or NULL on error
At present we don't detect errors, but when we do we'll return NULL. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/util/rfc1738.c5
-rw-r--r--lib/util/samba_util.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/util/rfc1738.c b/lib/util/rfc1738.c
index b285ae97e00..5474ea8a4f9 100644
--- a/lib/util/rfc1738.c
+++ b/lib/util/rfc1738.c
@@ -193,8 +193,8 @@ rfc1738_escape_part(TALLOC_CTX *mem_ctx, const char *url)
* rfc1738_unescape() - Converts escaped characters (%xy numbers) in
* given the string. %% is a %. %ab is the 8-bit hexadecimal number "ab"
*/
-_PUBLIC_ void
-rfc1738_unescape(char *s)
+
+_PUBLIC_ char *rfc1738_unescape(char *s)
{
char hexnum[3];
int i, j; /* i is write, j is read */
@@ -222,4 +222,5 @@ rfc1738_unescape(char *s)
}
}
s[i] = '\0';
+ return s + i;
}
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 3daf3dfdfd0..f6b3e23abc3 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -225,7 +225,7 @@ _PUBLIC_ char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_
/**
Unescape a URL encoded string, in place.
**/
-_PUBLIC_ void rfc1738_unescape(char *buf);
+_PUBLIC_ char *rfc1738_unescape(char *buf);
/**