[2/2] setup: Copy the description of a mac without ""

Message ID 20240924083433.48085-2-jonatan.schlag@ipfire.org
State New
Headers
Series [1/2] setup: Reformat the C Code |

Commit Message

Jonatan Schlag Sept. 24, 2024, 8:34 a.m. UTC
  This creates problems as the "" are invalid characters which our
new bash readhash refuses to accepts.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
---
 src/setup/netstuff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/src/setup/netstuff.c b/src/setup/netstuff.c
index ec4c31513..5967a7882 100644
--- a/src/setup/netstuff.c
+++ b/src/setup/netstuff.c
@@ -606,7 +606,7 @@  int scan_network_cards(void)
 				sprintf(nics[count].driver, "%s", temp_line+strlen(_driver));
 			}
 			if ( strncmp(temp_line, _desc, strlen(_desc)) ==  0 ) {
-				sprintf(nics[count].description, "%s", temp_line+strlen(_desc));
+				snprintf(nics[count].description, strlen(temp_line) - strlen(_desc) - 1,"%s", temp_line+strlen(_desc)+1 );
 			}
 			if ( strncmp(temp_line, _network_hwaddr, strlen(_network_hwaddr)) ==  0 ) {
 				sprintf(nics[count].macaddr,     "%s", temp_line+strlen(_network_hwaddr));