diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-11-14 16:36:39 +0400 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2019-01-14 00:44:29 +0100 |
commit | 37b9117faa7348b33b64a2be03b2e69b568249d8 (patch) | |
tree | 51dade5f4208a6cf90064a84f62ab4d4262bc072 /slirp/tftp.c | |
parent | 3a78c2f468e5458a7ce6658296b8af8019361ce6 (diff) |
slirp: replace ARRAY_SIZE with G_N_ELEMENTS
Do not require QEMU macro.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'slirp/tftp.c')
-rw-r--r-- | slirp/tftp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/slirp/tftp.c b/slirp/tftp.c index 735b57aa55..a9ba1480db 100644 --- a/slirp/tftp.c +++ b/slirp/tftp.c @@ -359,7 +359,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas, return; } - while (k < pktlen && nb_options < ARRAY_SIZE(option_name)) { + while (k < pktlen && nb_options < G_N_ELEMENTS(option_name)) { const char *key, *value; key = &tp->x.tp_buf[k]; @@ -403,7 +403,7 @@ static void tftp_handle_rrq(Slirp *slirp, struct sockaddr_storage *srcsas, } if (nb_options > 0) { - assert(nb_options <= ARRAY_SIZE(option_name)); + assert(nb_options <= G_N_ELEMENTS(option_name)); tftp_send_oack(spt, option_name, option_value, nb_options, tp); return; } |