Otherwise the line wraps at position where it does not make any sense.
Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- src/setup/netstuff.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/setup/netstuff.c b/src/setup/netstuff.c index 60e27242f..ec4c31513 100644 --- a/src/setup/netstuff.c +++ b/src/setup/netstuff.c @@ -602,9 +602,15 @@ int scan_network_cards(void) while (fgets(temp_line, STRING_SIZE, fp) != NULL) { temp_line[strlen(temp_line) -1] = 0; - if ( strncmp(temp_line, _driver, strlen(_driver)) == 0 ) 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)); - if ( strncmp(temp_line, _network_hwaddr, strlen(_network_hwaddr)) == 0 ) sprintf(nics[count].macaddr, "%s", temp_line+strlen(_network_hwaddr)); + if ( strncmp(temp_line, _driver, strlen(_driver)) == 0 ) { + 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)); + } + if ( strncmp(temp_line, _network_hwaddr, strlen(_network_hwaddr)) == 0 ) { + sprintf(nics[count].macaddr, "%s", temp_line+strlen(_network_hwaddr)); + } if (strlen(nics[count].macaddr) > 15 ) { sprintf(nics[count].nic, "%s", find_nic4mac(nics[count].macaddr)); count++;