mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-28 17:49:36 -04: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
1 changed files with 3 additions and 6 deletions
|
|
@ -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…
Reference in a new issue