summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-07-01 09:08:09 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-07-01 09:08:09 +0000
commit83107b85df5ecc7d6d5141b16c6f7fa48beff5fe (patch)
tree949a12d489f35c3989416cb3ea0ebabba62b41ff /examples
parent7fdc2fb58e801efadbb40f9abe76e1f638f3db66 (diff)
downloadmailutils-83107b85df5ecc7d6d5141b16c6f7fa48beff5fe.tar.gz
mailutils-83107b85df5ecc7d6d5141b16c6f7fa48beff5fe.tar.bz2
Fixed printf formats
(com_newgroups,com_newnews): Variable declarations are only allowed before the statements.
Diffstat (limited to 'examples')
-rw-r--r--examples/nntpclient.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/examples/nntpclient.c b/examples/nntpclient.c
index 22b2a09fd..047ce5142 100644
--- a/examples/nntpclient.c
+++ b/examples/nntpclient.c
@@ -409,7 +409,7 @@ com_head (char *arg)
stream_t stream = NULL;
int status;
- // No space allowed.
+ /* No space allowed. */
if (arg != NULL && strchr (arg, ' ') != NULL)
return EINVAL;
@@ -438,7 +438,7 @@ com_body (char *arg)
stream_t stream = NULL;
int status;
- // No space allowed.
+ /* No space allowed. */
if (arg != NULL && strchr (arg, ' ') != NULL)
return EINVAL;
@@ -467,7 +467,7 @@ com_article (char *arg)
stream_t stream = NULL;
int status;
- // No space allowed.
+ /* No space allowed. */
if (arg != NULL && strchr (arg, ' ') != NULL)
return EINVAL;
@@ -501,7 +501,7 @@ com_group (char *arg)
status = mu_nntp_group (nntp, arg, &total, &low, &high, &name);
if (status == 0)
{
- printf ("%s: low[%ld] high[%ld] total[%d]\n", (name == NULL) ? "" : name, low, high, total);
+ printf ("%s: low[%ld] high[%ld] total[%ld]\n", (name == NULL) ? "" : name, low, high, total);
free (name);
}
return status;
@@ -798,9 +798,10 @@ com_newgroups (char *arg)
{
iterator_t iterator = NULL;
struct tm stime;
+ int status;
int year, month, day, hour, min, sec, is_gmt;
year = month = day = hour = min = sec = is_gmt = 0;
-
+
if (arg != NULL && *arg != '\0')
{
char gmt[4];
@@ -822,7 +823,7 @@ com_newgroups (char *arg)
year = stime->tm_year + 1900; /* year */
}
- int status = mu_nntp_newgroups (nntp, year, month, day, hour, min, sec, is_gmt, &iterator);
+ status = mu_nntp_newgroups (nntp, year, month, day, hour, min, sec, is_gmt, &iterator);
if (status == 0)
{
printf ("New Groups:\n");
@@ -841,7 +842,7 @@ com_newgroups (char *arg)
printf (" group(%s)", group);
free (group);
}
- printf (" hig(%d) low(%d) status(%c)\n", high, low, stat);
+ printf (" hig(%lu) low(%lu) status(%c)\n", high, low, stat);
}
iterator_destroy (&iterator);
}
@@ -856,7 +857,8 @@ com_newnews (char *arg)
char *wildmat;
char gmt[4];
int year, month, day, hour, min, sec, is_gmt;
-
+ int status;
+
if (!valid_argument ("newnews", arg))
return EINVAL;
@@ -879,7 +881,7 @@ com_newnews (char *arg)
year = stime->tm_year + 1900; /* year */
}
- int status = mu_nntp_newnews (nntp, wildmat, year, month, day, hour, min, sec, is_gmt, &iterator);
+ status = mu_nntp_newnews (nntp, wildmat, year, month, day, hour, min, sec, is_gmt, &iterator);
if (status == 0)
{
printf ("New News:\n");
@@ -902,7 +904,7 @@ com_stat (char *arg)
unsigned long number = 0;
int status = 0;
- // No space allowed.
+ /* No space allowed. */
if (arg != NULL && strchr (arg, ' ') != NULL)
return EINVAL;
@@ -915,7 +917,7 @@ com_stat (char *arg)
}
if (status == 0)
{
- fprintf (stdout, "status: %d %s\n", number, (mid == NULL) ? "" : mid);
+ fprintf (stdout, "status: %ld %s\n", number, (mid == NULL) ? "" : mid);
free (mid);
}
return status;

Return to:

Send suggestions and report system problems to the System administrator.