replace strlens by breaks, fix comparison warnings.
[citadel.git] / citadel / utils / setup.c
index 539876b26bad12791e2584d39d4b65c6763c2b85..85288088cceaffa123718374f02cd3399945f334 100644 (file)
@@ -335,7 +335,7 @@ void important_message(const char *title, const char *msgtext)
                printf("       %s \n\n%s\n\n", title, msgtext);
                printf("%s", _("Press return to continue..."));
                if (fgets(buf, sizeof buf, stdin))
-                       ;
+               {;}
                break;
 
        case UI_DIALOG:
@@ -949,9 +949,10 @@ void fixnss(void) {
 
        while (fgets(buf, sizeof buf, fp_read) != NULL) {
                strcpy(buf_nc, buf);
-               for (i=0; i<strlen(buf_nc); ++i) {
+               for (i=0; buf_nc[i]; ++i) {
                        if (buf_nc[i] == '#') {
                                buf_nc[i] = 0;
+                               break;
                        }
                }
                for (i=0; i<strlen(buf_nc); ++i) {
@@ -969,7 +970,8 @@ void fixnss(void) {
                                }
                        }
                }
-               if (write(fd_write, buf, strlen(buf)) != strlen(buf)) {
+               long buflen = strlen(buf);
+               if (write(fd_write, buf, buflen) != buflen) {
                        fclose(fp_read);
                        close(fd_write);
                        unlink(new_filename);
@@ -1148,6 +1150,7 @@ void set_default_values(void)
        GetDefaultVALINT(c_xmpp_c2s_port, 5222);
        GetDefaultVALINT(c_xmpp_s2s_port, 5269);
        GetDefaultVALINT(c_nntp_port, 119);
+       GetDefaultVALINT(c_nntps_port, 563);
 #endif
 }
 
@@ -1222,8 +1225,7 @@ int main(int argc, char *argv[])
        enable_home = ( relh | home );
 
        if (chdir(ctdl_run_dir) != 0) {
-               display_error(_("Citadel Setup"), 
-                             "%s: [%s]\n", 
+               display_error("%s: [%s]\n", 
                              _("The directory you specified does not exist"), 
                              ctdl_run_dir);
                exit(errno);