]> code.citadel.org Git - citadel.git/blobdiff - citadel/setup.c
* The size constant "256" which shows up everywhere as a buffer size has now
[citadel.git] / citadel / setup.c
index 7705768ec44efa9ee5009c825cc6fc53a271ffcc..fb6cb0333d57fd57432e8f0b51e5f7247939086c 100644 (file)
@@ -460,8 +460,8 @@ void check_services_entry(void)
 void check_inittab_entry(void)
 {
        FILE *infp;
-       char buf[256];
-       char looking_for[256];
+       char buf[SIZ];
+       char looking_for[SIZ];
        char question[128];
        char *ptr;
        int have_entry = 0;
@@ -477,7 +477,7 @@ void check_inittab_entry(void)
        if (infp == NULL) {
                return;
        } else {
-               while (fgets(buf, 256, infp) != NULL) {
+               while (fgets(buf, sizeof buf, infp) != NULL) {
                        buf[strlen(buf) - 1] = 0;
                        ptr = strtok(buf, ":");
                        ptr = strtok(NULL, ":");
@@ -539,7 +539,7 @@ void set_str_val(int msgpos, char str[])
 {
        char buf[4096];
        char tempfile[64];
-       char setupmsg[256];
+       char setupmsg[SIZ];
 
        strcpy(tempfile, tmpnam(NULL));
        strcpy(setupmsg, "");
@@ -849,8 +849,9 @@ int main(int argc, char *argv[])
        /*
         * Default port numbers for various services
         */
-       if (config.c_pop3_port == 0) config.c_pop3_port = (-1);
-       if (config.c_smtp_port == 0) config.c_smtp_port = (-1);
+       if (config.c_smtp_port == 0) config.c_smtp_port = 25;
+       if (config.c_pop3_port == 0) config.c_pop3_port = 110;
+       if (config.c_imap_port == 0) config.c_imap_port = 143;
 
 
        /* Go through a series of dialogs prompting for config info */