diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2020-01-21 15:50:25 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2020-01-22 13:16:27 +0400 |
commit | 524971e5b6c673a654f7b5fc04f3d9e2dfe63763 (patch) | |
tree | 2e36a7c843d9f4136da44352db92cae8542ddcfb /src | |
parent | a4457cf5e19eca116efb78b65edc36fcc8c76ba2 (diff) | |
download | slirp-524971e5b6c673a654f7b5fc04f3d9e2dfe63763.zip slirp-524971e5b6c673a654f7b5fc04f3d9e2dfe63763.tar.gz slirp-524971e5b6c673a654f7b5fc04f3d9e2dfe63763.tar.bz2 |
bootp: replace simple snprintf() with strcpy()
Minor code simplification.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/bootp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bootp.c b/src/bootp.c index 477de3f..46e9681 100644 --- a/src/bootp.c +++ b/src/bootp.c @@ -254,9 +254,10 @@ static void bootp_reply(Slirp *slirp, const struct bootp_t *bp) *q++ = DHCPACK; } - if (slirp->bootp_filename) - snprintf(rbp->bp_file, sizeof(rbp->bp_file), "%s", - slirp->bootp_filename); + if (slirp->bootp_filename) { + g_assert(strlen(slirp->bootp_filename) < sizeof(rbp->bp_file)); + strcpy(rbp->bp_file, slirp->bootp_filename); + } *q++ = RFC2132_SRV_ID; *q++ = 4; |