diff options
author | Ted Gould <ted@gould.cx> | 2012-08-27 15:11:13 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-08-27 15:11:13 -0500 |
commit | 1708318511cf61c58913e8f14a8fb56ff1510bdd (patch) | |
tree | 03a7d059e312dce1e9f14aeb35d3b03af2d580ef /src | |
parent | d4ba1e134fcce95f8b7983fa9fba6d9d18f8f68b (diff) | |
download | libpam-x2go-1708318511cf61c58913e8f14a8fb56ff1510bdd.tar.gz libpam-x2go-1708318511cf61c58913e8f14a8fb56ff1510bdd.tar.bz2 libpam-x2go-1708318511cf61c58913e8f14a8fb56ff1510bdd.zip |
Using 'strstr' instead our own loop.
Diffstat (limited to 'src')
-rw-r--r-- | src/pam-freerdp.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pam-freerdp.c b/src/pam-freerdp.c index 440ee40..0277e0c 100644 --- a/src/pam-freerdp.c +++ b/src/pam-freerdp.c @@ -92,13 +92,12 @@ get_item (pam_handle_t * pamh, int type) if ((subloc = strstr(retval, "://")) != NULL) { char * original = retval; char * newish = retval + strlen("://"); - char * c; - for (c = newish; *c != '\0'; c++) { - if (*c == '/') { - *c = '\0'; - break; - } + char * c = strstr(newish, "/"); + + if (c != NULL) { + c[0] = '\0'; } + retval = strdup(newish); free(original); } |