kopia lustrzana https://gitlab.com/sane-project/backends
scanimage: Un-word-wrap auth_callback to improve readability
This is one of those cases where word-wrapping to less than 80 or so characters isn't helpful in understanding the code.merge-requests/213/head
rodzic
bac0c4abce
commit
5e6a111ffa
|
@ -211,39 +211,21 @@ auth_callback (SANE_String_Const resource,
|
||||||
if (strchr (strchr (tmp, ':') + 1, ':') != NULL)
|
if (strchr (strchr (tmp, ':') + 1, ':') != NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((strncmp
|
if ((strncmp (strchr (strchr (tmp, ':') + 1, ':') + 1, resource, len) == 0)
|
||||||
(strchr (strchr (tmp, ':') + 1, ':') + 1,
|
&& ((int) strlen (strchr (strchr (tmp, ':') + 1, ':') + 1) == len))
|
||||||
resource, len) == 0)
|
|
||||||
&&
|
|
||||||
((int) strlen
|
|
||||||
(strchr (strchr (tmp, ':') + 1, ':') + 1) ==
|
|
||||||
len))
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((strchr (tmp, ':') - tmp) <
|
if ((strchr (tmp, ':') - tmp) < SANE_MAX_USERNAME_LEN)
|
||||||
SANE_MAX_USERNAME_LEN)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((strchr (strchr (tmp, ':') + 1, ':') -
|
if ((strchr (strchr (tmp, ':') + 1, ':') - (strchr (tmp, ':') + 1)) < SANE_MAX_PASSWORD_LEN)
|
||||||
(strchr (tmp, ':') + 1)) <
|
|
||||||
SANE_MAX_PASSWORD_LEN)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
strncpy (username, tmp,
|
strncpy (username, tmp, strchr (tmp, ':') - tmp);
|
||||||
strchr (tmp, ':') - tmp);
|
|
||||||
|
|
||||||
username[strchr (tmp, ':') - tmp] = 0;
|
username[strchr (tmp, ':') - tmp] = 0;
|
||||||
|
|
||||||
strncpy (password,
|
strncpy (password, strchr (tmp, ':') + 1, strchr (strchr (tmp, ':') + 1, ':') - (strchr (tmp, ':') + 1));
|
||||||
strchr (tmp, ':') + 1,
|
password[strchr (strchr (tmp, ':') + 1, ':') - (strchr (tmp, ':') + 1)] = 0;
|
||||||
strchr (strchr (tmp, ':') + 1,
|
|
||||||
':') -
|
|
||||||
(strchr (tmp, ':') + 1));
|
|
||||||
password[strchr
|
|
||||||
(strchr (tmp, ':') + 1,
|
|
||||||
':') - (strchr (tmp,
|
|
||||||
':') + 1)] =
|
|
||||||
0;
|
|
||||||
|
|
||||||
query_user = 0;
|
query_user = 0;
|
||||||
break;
|
break;
|
||||||
|
|
Ładowanie…
Reference in New Issue