summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorjwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68>2001-02-22 04:16:55 +0000
committerjwoolley <jwoolley@13f79535-47bb-0310-9956-ffa450edef68>2001-02-22 04:16:55 +0000
commit4e2d1e05ee73e57e8d0aa00a3fd4911588db1c14 (patch)
tree169c3322d44ebd7b1148b63aab25290d6ac7ce4d /user
parente0872ae343679b6835fb3bf60b5f08aab46b36e8 (diff)
downloadlibapr-4e2d1e05ee73e57e8d0aa00a3fd4911588db1c14.tar.gz
Remove some duplicate calls to strchr(), and remove a typo as a side-effect
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61281 13f79535-47bb-0310-9956-ffa450edef68
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
*/