diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2019-12-08 00:28:21 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2020-07-08 19:54:28 -0400 |
commit | ca97505a7292286d05f23080fd0acfe8b7cebd89 (patch) | |
tree | 072eae5d3f94b9713e61f15f7d552d864cdca59a /src/mod_vhostdb_ldap.c | |
parent | 3e8cdb2e543e5976396c7e0e7bd429a116c32313 (diff) | |
download | lighttpd-git-ca97505a7292286d05f23080fd0acfe8b7cebd89.tar.gz |
[multiple] store srv->tmp_buf in tb var
rather than using srv->tmp_buf directly in code modifying temp buf (tb)
Diffstat (limited to 'src/mod_vhostdb_ldap.c')
-rw-r--r-- | src/mod_vhostdb_ldap.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mod_vhostdb_ldap.c b/src/mod_vhostdb_ldap.c index c1268156..576fd680 100644 --- a/src/mod_vhostdb_ldap.c +++ b/src/mod_vhostdb_ldap.c @@ -55,7 +55,8 @@ static void mod_vhostdb_dbconf_add_scheme (server *srv, buffer *host) "ldap://", "ldaps://", "ldapi://", "cldap://" }; char *b, *e = host->ptr; - buffer_clear(srv->tmp_buf); + buffer * const tb = srv->tmp_buf; + buffer_clear(tb); while (*(b = e)) { unsigned int j; while (*b==' '||*b=='\t'||*b=='\r'||*b=='\n'||*b==',') ++b; @@ -63,19 +64,18 @@ static void mod_vhostdb_dbconf_add_scheme (server *srv, buffer *host) e = b; while (*e!=' '&&*e!='\t'&&*e!='\r'&&*e!='\n'&&*e!=','&&*e!='\0') ++e; - if (!buffer_string_is_empty(srv->tmp_buf)) - buffer_append_string_len(srv->tmp_buf, CONST_STR_LEN(",")); + if (!buffer_string_is_empty(tb)) + buffer_append_string_len(tb, CONST_STR_LEN(",")); for (j = 0; j < sizeof(schemes)/sizeof(char *); ++j) { if (buffer_eq_icase_ssn(b, schemes[j], strlen(schemes[j]))) { break; } } if (j == sizeof(schemes)/sizeof(char *)) - buffer_append_string_len(srv->tmp_buf, - CONST_STR_LEN("ldap://")); - buffer_append_string_len(srv->tmp_buf, b, (size_t)(e - b)); + buffer_append_string_len(tb, CONST_STR_LEN("ldap://")); + buffer_append_string_len(tb, b, (size_t)(e - b)); } - buffer_copy_buffer(host, srv->tmp_buf); + buffer_copy_buffer(host, tb); } } |