summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
Diffstat (limited to 'user')
-rw-r--r--user/win32/userinfo.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
index 4ba7699dd..d3334ff91 100644
--- a/user/win32/userinfo.c
+++ b/user/win32/userinfo.c
@@ -71,14 +71,15 @@ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
SID_NAME_USE sidtype;
char *domain = NULL;
DWORD sidlen, rv;
+ char *pos;
- if (strchr(username, '/')) {
- domain = apr_pstrndup(p, username, strchr(username, '/') - username);
- username += strlen(domain) + 1;
+ if (pos = strchr(username, '/')) {
+ domain = apr_pstrndup(p, username, pos - username);
+ username = pos + 1;
}
- else if (strchr(username, '\\')) {
- domain = apr_pstrndup(p, username, strchr(username, '/') - username);
- username += strlen(domain) + 1;
+ else if (pos = strchr(username, '\\')) {
+ domain = apr_pstrndup(p, username, pos - username);
+ username = pos + 1;
}
/* Get nothing on the first pass ... need to size the sid buffer
*/