From 670b3aba0c30ed365653865f426a3de48b5ac568 Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Fri, 3 Jun 2005 13:30:43 +0000 Subject: [PATCH] Applied patch #1214251 from Thorsten Kukuk for some compiler warnings. git-svn-id: file:///tmp/cracklib-svn/trunk@55 4175fe1e-86d5-4fdc-8e6a-506fab9d8533 --- cracklib/ChangeLog | 3 +++ cracklib/lib/packlib.c | 8 +++----- cracklib/util/check.c | 1 + cracklib/util/packer.c | 7 ++++--- cracklib/util/teststr.c | 3 +-- cracklib/util/unpacker.c | 1 - 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cracklib/ChangeLog b/cracklib/ChangeLog index 1336b83..3e62727 100644 --- a/cracklib/ChangeLog +++ b/cracklib/ChangeLog @@ -1,3 +1,6 @@ +2005-06-03: + * Applied patch #1214251 from Thorsten Kukuk for some compiler warnings. + 2005-02-14: * Integrated the redhat/fedora patch for broken 64bit dictionaries diff --git a/cracklib/lib/packlib.c b/cracklib/lib/packlib.c index 139789e..ae7d8f3 100644 --- a/cracklib/lib/packlib.c +++ b/cracklib/lib/packlib.c @@ -61,14 +61,12 @@ PWOpen(prefix, mode) char *prefix; char *mode; { - uint32_t i; int use64 = 0; static PWDICT pdesc; static PWDICT64 pdesc64; char iname[STRINGSIZE]; char dname[STRINGSIZE]; char wname[STRINGSIZE]; - char buffer[STRINGSIZE]; FILE *dfp; FILE *ifp; FILE *wfp; @@ -99,7 +97,7 @@ PWOpen(prefix, mode) return ((PWDICT *) 0); } - if (pdesc.wfp = fopen(wname, mode)) + if ((pdesc.wfp = fopen(wname, mode))) { pdesc.flags |= PFOR_USEHWMS; } @@ -406,7 +404,7 @@ GetPW(pwp, number) bptr = buffer; - for (ostr = data[0]; *(ostr++) = *(bptr++); /* nothing */ ); + for (ostr = data[0]; (*(ostr++) = *(bptr++)); /* nothing */ ); ostr = data[0]; @@ -416,7 +414,7 @@ GetPW(pwp, number) strcpy(nstr, ostr); ostr = nstr + *(bptr++); - while (*(ostr++) = *(bptr++)); + while ((*(ostr++) = *(bptr++))); ostr = nstr; } diff --git a/cracklib/util/check.c b/cracklib/util/check.c index 9945dcc..1df4f37 100644 --- a/cracklib/util/check.c +++ b/cracklib/util/check.c @@ -1,5 +1,6 @@ #include #include +#include #define IN_CRACKLIB #include "config.h" diff --git a/cracklib/util/packer.c b/cracklib/util/packer.c index 0d3cdd8..850492f 100644 --- a/cracklib/util/packer.c +++ b/cracklib/util/packer.c @@ -7,6 +7,7 @@ */ #include +#include #define IN_CRACKLIB #include "config.h" @@ -58,13 +59,13 @@ main(argc, argv) if (!buffer[0]) { - fprintf(stderr, "skipping line: %lu\n", readed); + fprintf(stderr, "skipping line: %u\n", readed); continue; } if (PutPW(pwp, buffer)) { - fprintf(stderr, "error: PutPW '%s' line %luy\n", buffer, readed); + fprintf(stderr, "error: PutPW '%s' line %uy\n", buffer, readed); } wrote++; @@ -72,7 +73,7 @@ main(argc, argv) PWClose(pwp); - printf("%lu %lu\n", readed, wrote); + printf("%u %u\n", readed, wrote); return (0); } diff --git a/cracklib/util/teststr.c b/cracklib/util/teststr.c index 7915275..f67e769 100644 --- a/cracklib/util/teststr.c +++ b/cracklib/util/teststr.c @@ -14,7 +14,6 @@ int main () { - uint32_t i; PWDICT *pwp; char buffer[STRINGSIZE]; @@ -32,7 +31,7 @@ main () Chop(buffer); i = FindPW(pwp, buffer); - printf ("%s: %lu%s\n", buffer, i, (i==PW_WORDS(pwp) ? " **** NOT FOUND ****" : "")); + printf ("%s: %u%s\n", buffer, i, (i==PW_WORDS(pwp) ? " **** NOT FOUND ****" : "")); } return (0); diff --git a/cracklib/util/unpacker.c b/cracklib/util/unpacker.c index e7dfe8f..b7069f4 100644 --- a/cracklib/util/unpacker.c +++ b/cracklib/util/unpacker.c @@ -20,7 +20,6 @@ main(argc, argv) { uint32_t i; PWDICT *pwp; - char buffer[STRINGSIZE]; if (argc <= 1) { -- 2.40.0