* edit_value(): if no environment variable specified, use ""
authorWilfried Göesgens <willi@citadel.org>
Mon, 16 Aug 2010 19:48:03 +0000 (19:48 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 16 Aug 2010 19:48:03 +0000 (19:48 +0000)
* set_str_val(): don't check NULL here, expect it to be non-null.

citadel/utils/setup.c

index 01135119179b22ced4d91b7c1777bc601b1e6004..f69f52bebfd4b7bd4434744b65b21b92c45dead2 100644 (file)
@@ -842,13 +842,10 @@ void set_bool_val(int msgpos, int *ip, char *DefValue)
 
 void set_str_val(int msgpos, char *Target, char *DefValue) 
 {
-       if (DefValue != NULL)
-       {
-               strprompt(setup_titles[msgpos], 
-                         setup_text[msgpos], 
-                         Target, 
-                         DefValue);
-       }
+       strprompt(setup_titles[msgpos], 
+                 setup_text[msgpos], 
+                 Target, 
+                 DefValue);
 }
 
 void set_int_val(int msgpos, int *ip, char *DefValue)
@@ -889,6 +886,8 @@ void edit_value(int curr)
        {
                Value = getenv(EnvNames[curr]);
        }
+       if (Value == NULL)
+               Value = "";
 
 
        switch (curr) {