Commit 83107b85 83107b85df5ecc7d6d5141b16c6f7fa48beff5fe by Sergey Poznyakoff

Fixed printf formats

(com_newgroups,com_newnews): Variable declarations are only allowed
before the statements.
1 parent 7fdc2fb5
...@@ -409,7 +409,7 @@ com_head (char *arg) ...@@ -409,7 +409,7 @@ com_head (char *arg)
409 stream_t stream = NULL; 409 stream_t stream = NULL;
410 int status; 410 int status;
411 411
412 // No space allowed. 412 /* No space allowed. */
413 if (arg != NULL && strchr (arg, ' ') != NULL) 413 if (arg != NULL && strchr (arg, ' ') != NULL)
414 return EINVAL; 414 return EINVAL;
415 415
...@@ -438,7 +438,7 @@ com_body (char *arg) ...@@ -438,7 +438,7 @@ com_body (char *arg)
438 stream_t stream = NULL; 438 stream_t stream = NULL;
439 int status; 439 int status;
440 440
441 // No space allowed. 441 /* No space allowed. */
442 if (arg != NULL && strchr (arg, ' ') != NULL) 442 if (arg != NULL && strchr (arg, ' ') != NULL)
443 return EINVAL; 443 return EINVAL;
444 444
...@@ -467,7 +467,7 @@ com_article (char *arg) ...@@ -467,7 +467,7 @@ com_article (char *arg)
467 stream_t stream = NULL; 467 stream_t stream = NULL;
468 int status; 468 int status;
469 469
470 // No space allowed. 470 /* No space allowed. */
471 if (arg != NULL && strchr (arg, ' ') != NULL) 471 if (arg != NULL && strchr (arg, ' ') != NULL)
472 return EINVAL; 472 return EINVAL;
473 473
...@@ -501,7 +501,7 @@ com_group (char *arg) ...@@ -501,7 +501,7 @@ com_group (char *arg)
501 status = mu_nntp_group (nntp, arg, &total, &low, &high, &name); 501 status = mu_nntp_group (nntp, arg, &total, &low, &high, &name);
502 if (status == 0) 502 if (status == 0)
503 { 503 {
504 printf ("%s: low[%ld] high[%ld] total[%d]\n", (name == NULL) ? "" : name, low, high, total); 504 printf ("%s: low[%ld] high[%ld] total[%ld]\n", (name == NULL) ? "" : name, low, high, total);
505 free (name); 505 free (name);
506 } 506 }
507 return status; 507 return status;
...@@ -798,9 +798,10 @@ com_newgroups (char *arg) ...@@ -798,9 +798,10 @@ com_newgroups (char *arg)
798 { 798 {
799 iterator_t iterator = NULL; 799 iterator_t iterator = NULL;
800 struct tm stime; 800 struct tm stime;
801 int status;
801 int year, month, day, hour, min, sec, is_gmt; 802 int year, month, day, hour, min, sec, is_gmt;
802 year = month = day = hour = min = sec = is_gmt = 0; 803 year = month = day = hour = min = sec = is_gmt = 0;
803 804
804 if (arg != NULL && *arg != '\0') 805 if (arg != NULL && *arg != '\0')
805 { 806 {
806 char gmt[4]; 807 char gmt[4];
...@@ -822,7 +823,7 @@ com_newgroups (char *arg) ...@@ -822,7 +823,7 @@ com_newgroups (char *arg)
822 year = stime->tm_year + 1900; /* year */ 823 year = stime->tm_year + 1900; /* year */
823 } 824 }
824 825
825 int status = mu_nntp_newgroups (nntp, year, month, day, hour, min, sec, is_gmt, &iterator); 826 status = mu_nntp_newgroups (nntp, year, month, day, hour, min, sec, is_gmt, &iterator);
826 if (status == 0) 827 if (status == 0)
827 { 828 {
828 printf ("New Groups:\n"); 829 printf ("New Groups:\n");
...@@ -841,7 +842,7 @@ com_newgroups (char *arg) ...@@ -841,7 +842,7 @@ com_newgroups (char *arg)
841 printf (" group(%s)", group); 842 printf (" group(%s)", group);
842 free (group); 843 free (group);
843 } 844 }
844 printf (" hig(%d) low(%d) status(%c)\n", high, low, stat); 845 printf (" hig(%lu) low(%lu) status(%c)\n", high, low, stat);
845 } 846 }
846 iterator_destroy (&iterator); 847 iterator_destroy (&iterator);
847 } 848 }
...@@ -856,7 +857,8 @@ com_newnews (char *arg) ...@@ -856,7 +857,8 @@ com_newnews (char *arg)
856 char *wildmat; 857 char *wildmat;
857 char gmt[4]; 858 char gmt[4];
858 int year, month, day, hour, min, sec, is_gmt; 859 int year, month, day, hour, min, sec, is_gmt;
859 860 int status;
861
860 if (!valid_argument ("newnews", arg)) 862 if (!valid_argument ("newnews", arg))
861 return EINVAL; 863 return EINVAL;
862 864
...@@ -879,7 +881,7 @@ com_newnews (char *arg) ...@@ -879,7 +881,7 @@ com_newnews (char *arg)
879 year = stime->tm_year + 1900; /* year */ 881 year = stime->tm_year + 1900; /* year */
880 } 882 }
881 883
882 int status = mu_nntp_newnews (nntp, wildmat, year, month, day, hour, min, sec, is_gmt, &iterator); 884 status = mu_nntp_newnews (nntp, wildmat, year, month, day, hour, min, sec, is_gmt, &iterator);
883 if (status == 0) 885 if (status == 0)
884 { 886 {
885 printf ("New News:\n"); 887 printf ("New News:\n");
...@@ -902,7 +904,7 @@ com_stat (char *arg) ...@@ -902,7 +904,7 @@ com_stat (char *arg)
902 unsigned long number = 0; 904 unsigned long number = 0;
903 int status = 0; 905 int status = 0;
904 906
905 // No space allowed. 907 /* No space allowed. */
906 if (arg != NULL && strchr (arg, ' ') != NULL) 908 if (arg != NULL && strchr (arg, ' ') != NULL)
907 return EINVAL; 909 return EINVAL;
908 910
...@@ -915,7 +917,7 @@ com_stat (char *arg) ...@@ -915,7 +917,7 @@ com_stat (char *arg)
915 } 917 }
916 if (status == 0) 918 if (status == 0)
917 { 919 {
918 fprintf (stdout, "status: %d %s\n", number, (mid == NULL) ? "" : mid); 920 fprintf (stdout, "status: %ld %s\n", number, (mid == NULL) ? "" : mid);
919 free (mid); 921 free (mid);
920 } 922 }
921 return status; 923 return status;
......