mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
BUILD: server: check->desc always exists
Clang reports this warning : src/server.c:872:14: warning: address of array 'check->desc' will always evaluate to 'true' [-Wpointer-bool-conversion] Indeed, check->desc used to be a pointer to a dynamically allocated area a long time ago and is now an array. Let's remove the useless test.
This commit is contained in:
parent
1f09467114
commit
358847f026
@ -869,8 +869,7 @@ void srv_set_stopped(struct server *s, const char *reason, struct check *check)
|
||||
strlcpy2(s->op_st_chg.reason, reason, sizeof(s->op_st_chg.reason));
|
||||
}
|
||||
else if (check) {
|
||||
if (check->desc)
|
||||
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
||||
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
||||
s->op_st_chg.code = check->code;
|
||||
s->op_st_chg.status = check->status;
|
||||
s->op_st_chg.duration = check->duration;
|
||||
@ -908,8 +907,7 @@ void srv_set_running(struct server *s, const char *reason, struct check *check)
|
||||
strlcpy2(s->op_st_chg.reason, reason, sizeof(s->op_st_chg.reason));
|
||||
}
|
||||
else if (check) {
|
||||
if (check->desc)
|
||||
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
||||
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
||||
s->op_st_chg.code = check->code;
|
||||
s->op_st_chg.status = check->status;
|
||||
s->op_st_chg.duration = check->duration;
|
||||
@ -952,8 +950,7 @@ void srv_set_stopping(struct server *s, const char *reason, struct check *check)
|
||||
strlcpy2(s->op_st_chg.reason, reason, sizeof(s->op_st_chg.reason));
|
||||
}
|
||||
else if (check) {
|
||||
if (check->desc)
|
||||
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
||||
strlcpy2(s->op_st_chg.reason, check->desc, sizeof(s->op_st_chg.reason));
|
||||
s->op_st_chg.code = check->code;
|
||||
s->op_st_chg.status = check->status;
|
||||
s->op_st_chg.duration = check->duration;
|
||||
|
Loading…
x
Reference in New Issue
Block a user