0
0
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:
Przemyslaw Pawelczyk 2011-01-27 23:11:32 +01:00
parent 39b2639bdb
commit ddbf2d28ab

View File

@ -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';
}