Signed-off-by: Michael Tremer michael.tremer@ipfire.org --- src/setup/dhcp.c | 2 +- src/setup/main.c | 1 - src/setup/misc.c | 1 - src/setup/netstuff.c | 19 +++++++++---------- src/setup/networking.c | 9 ++------- 5 files changed, 12 insertions(+), 20 deletions(-)
diff --git a/src/setup/dhcp.c b/src/setup/dhcp.c index 22f471851..48381f72f 100644 --- a/src/setup/dhcp.c +++ b/src/setup/dhcp.c @@ -38,7 +38,7 @@ void dhcpdialogcallbackdhcp(newtComponent cm, void *data);
int handledhcp(void) { - char *results[MAX_BOXES]; + const char *results[MAX_BOXES]; char enabledresult; char startenabled; struct newtExitStruct es; diff --git a/src/setup/main.c b/src/setup/main.c index adb98a231..c51c6e8fe 100644 --- a/src/setup/main.c +++ b/src/setup/main.c @@ -30,7 +30,6 @@ int main(int argc, char *argv[]) struct keyvalue *kv; char lang[STRING_SIZE] = "en_US.utf8"; char title[STRING_SIZE]; - int langcounter; int autook = 0;
/* Log file/terminal stuff. */ diff --git a/src/setup/misc.c b/src/setup/misc.c index f9ba39b8c..6c1033598 100644 --- a/src/setup/misc.c +++ b/src/setup/misc.c @@ -21,7 +21,6 @@ extern int automode;
int writehostsfiles(void) { - char message[1000]; struct keyvalue *kv; char hostname[STRING_SIZE]; char domainname[STRING_SIZE] = "localdomain"; diff --git a/src/setup/netstuff.c b/src/setup/netstuff.c index 1e196dc1e..60e27242f 100644 --- a/src/setup/netstuff.c +++ b/src/setup/netstuff.c @@ -52,11 +52,11 @@ static int ip_input_filter(newtComponent entry, void * data, int ch, int cursor) int changeaddress(struct keyvalue *kv, char *colour, int typeflag, char *defaultdhcphostname) { - char *addressresult; - char *netmaskresult; - char *gatewayresult; - char *dhcphostnameresult; - char *dhcpforcemturesult; + const char *addressresult; + const char *netmaskresult; + const char *gatewayresult; + const char *dhcphostnameresult; + const char *dhcpforcemturesult; struct newtExitStruct es; newtComponent header; newtComponent addresslabel; @@ -480,14 +480,14 @@ char* readmac(char *card) { char* find_nic4mac(char *findmac) { DIR *dir; struct dirent *dirzeiger; - char temp[STRING_SIZE], temp2[STRING_SIZE]; + char temp[STRING_SIZE] = ""; + char temp2[STRING_SIZE] = "";
if((dir=opendir(SYSDIR)) == NULL) { fprintf(flog,"Fehler bei opendir (find_name4nic) ...\n"); return NULL; }
- sprintf(temp, ""); while((dirzeiger=readdir(dir)) != NULL) { if(*((*dirzeiger).d_name) != '.' & strcmp(((*dirzeiger).d_name), "lo") != 0) { sprintf(temp2, "%s", readmac((*dirzeiger).d_name) ); @@ -550,7 +550,6 @@ int rename_nics(void) {
int write_configs_netudev(int card , int colour) { - char commandstring[STRING_SIZE]; struct keyvalue *kv = initkeyvalues(); char temp1[STRING_SIZE], temp2[STRING_SIZE], temp3[STRING_SIZE]; char ucolour[STRING_SIZE]; @@ -586,7 +585,7 @@ int write_configs_netudev(int card , int colour) int scan_network_cards(void) { FILE *fp; - char driver[STRING_SIZE], description[STRING_SIZE], macaddr[STRING_SIZE], temp_line[STRING_SIZE]; + char temp_line[STRING_SIZE]; int count = 0; const char _driver[]="driver: "; const char _desc[]="desc: "; @@ -732,7 +731,7 @@ int ask_clear_card_entry(int card) sprintf(message, _("Do you really want to remove the assigned %s interface?"), ucolourcard[card]); rc = newtWinChoice(_("Warning"), _("OK"), _("Cancel"), message);
- if ( rc = 0 || rc == 1) { + if ( rc == 0 || rc == 1) { clear_card_entry(card); } else return 1;
diff --git a/src/setup/networking.c b/src/setup/networking.c index 9dd5205e5..8d398f365 100644 --- a/src/setup/networking.c +++ b/src/setup/networking.c @@ -385,7 +385,7 @@ int drivermenu(void) if (strcmp(knics[i].macaddr, "")) kcount++;
- if (neednics = kcount) + if (neednics == kcount) { strcat(message, "\n"); strcat(message, _("Do you wish to change these settings?")); @@ -403,11 +403,6 @@ int drivermenu(void) return 1; }
-int set_menu_entry_for(int *nr, int *card) -{ - -} - int changedrivers(void) { struct keyvalue *kv = initkeyvalues(); @@ -438,7 +433,7 @@ int changedrivers(void) { green = 1; red = 1; blue = 1; } else if (configtype == 4) { green = 1; red=1; orange=1; blue = 1; } - else if (configtype == "") + else { green = 1; red = 1; }
do