mirror of
https://github.com/darkk/redsocks.git
synced 2025-08-29 05:05:30 +00:00
Use 'else if' in digest_authentication_encode().
In string comparison if-chain it's better to use 'else if', because it clearly shows that conditions are exclusive.
This commit is contained in:
parent
39b2639bdb
commit
ddbf2d28ab
@ -156,15 +156,15 @@ char* digest_authentication_encode(const char *line, const char *user, const cha
|
||||
strncpy(realm = calloc(valuelen + 1, 1), value.b, valuelen);
|
||||
realm[valuelen] = '\0';
|
||||
}
|
||||
if (strncasecmp(name.b, "opaque", namelen) == 0) {
|
||||
else if (strncasecmp(name.b, "opaque", namelen) == 0) {
|
||||
strncpy(opaque = calloc(valuelen + 1, 1), value.b, valuelen);
|
||||
opaque[valuelen] = '\0';
|
||||
}
|
||||
if (strncasecmp(name.b, "nonce" , namelen) == 0) {
|
||||
else if (strncasecmp(name.b, "nonce" , namelen) == 0) {
|
||||
strncpy(nonce = calloc(valuelen + 1, 1), value.b, valuelen);
|
||||
nonce[valuelen] = '\0';
|
||||
}
|
||||
if (strncasecmp(name.b, "qop" , namelen) == 0) {
|
||||
else if (strncasecmp(name.b, "qop" , namelen) == 0) {
|
||||
strncpy(qop = calloc(valuelen + 1, 1), value.b, valuelen);
|
||||
qop[valuelen] = '\0';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user