From 2e0e55967c0269ba7e1239f56c6fcc18814c80a1 Mon Sep 17 00:00:00 2001 From: logicog Date: Sun, 19 Apr 2026 17:21:13 +0200 Subject: [PATCH] Do not send SFP info if no SFP port present --- httpd/page_impl.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/httpd/page_impl.c b/httpd/page_impl.c index 09c60b0..761f554 100644 --- a/httpd/page_impl.c +++ b/httpd/page_impl.c @@ -243,14 +243,16 @@ void send_basic_info(void) slen += strtox(outbuf + slen, "\",\"flash_size\":\""); string_to_html(get_flash_size_str()); - slen += strtox(outbuf + slen, "\",\"sfp_slot_0\":\""); - send_sfp_info(0); - char_to_html('"'); - if (machine.n_sfp == 2) { - slen += strtox(outbuf + slen, ",\"sfp_slot_1\":\""); - send_sfp_info(1); - char_to_html('"'); + if (machine.n_sfp) { + slen += strtox(outbuf + slen, "\",\"sfp_slot_0\":\""); + send_sfp_info(0); + if (machine.n_sfp == 2) { + slen += strtox(outbuf + slen, "\",\"sfp_slot_1\":\""); + send_sfp_info(1); + } } + char_to_html('"'); + char_to_html('}'); }