diff options
author | jbj <jbj> | 2004-02-26 01:20:53 +0000 |
---|---|---|
committer | jbj <jbj> | 2004-02-26 01:20:53 +0000 |
commit | 005876837b0420120a5ae37e899baf88f1f1fa03 (patch) | |
tree | 8058bd5cea3bf2439d5193c096420e60a4ed6099 | |
parent | a8a222fef60fd0f5f9609d53d60ab3fe54a3a9c4 (diff) | |
download | libpopt-005876837b0420120a5ae37e899baf88f1f1fa03.tar.gz |
splint fiddles.
-rw-r--r-- | popthelp.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -13,6 +13,7 @@ #define POPT_WCHAR_HACK #ifdef POPT_WCHAR_HACK #include <wchar.h> /* for mbsrtowcs */ +/*@access mbstate_t @*/ #endif #include "poptint.h" @@ -340,11 +341,11 @@ static void singleOptionHelp(FILE * fp, size_t maxLeftCol, mbstate_t t; size_t n; - memset (&t, '\0', sizeof (t)); /* In initial state. */ + memset ((void *)&t, '\0', sizeof (t)); /* In initial state. */ /* Determine number of characters. */ n = mbsrtowcs (NULL, &scopy, strlen(scopy), &t); - displaypad = (lelen-n); + displaypad = (int) (lelen-n); } #endif } @@ -381,7 +382,7 @@ static void singleOptionHelp(FILE * fp, size_t maxLeftCol, while (ch > (help + 1) && isspace(*ch)) ch--; ch++; - sprintf(format, "%%.%ds\n%%%ds", (int) (ch - help), indentLength); + sprintf(format, "%%.%ds\n%%%ds", (int) (ch - help), (int) indentLength); /*@-formatconst@*/ fprintf(fp, format, help, " "); /*@=formatconst@*/ @@ -439,7 +440,9 @@ static size_t maxArgWidth(const struct poptOption * opt, mbstate_t t; size_t n; - memset (&t, '\0', sizeof (t)); /* In initial state. */ +/*@-boundswrite@*/ + memset ((void *)&t, '\0', sizeof (t)); /* In initial state. */ +/*@=boundswrite@*/ /* Determine number of characters. */ n = mbsrtowcs (NULL, &scopy, strlen(scopy), &t); len += sizeof("=")-1 + n; @@ -613,7 +616,9 @@ static size_t singleOptionUsage(FILE * fp, size_t cursor, mbstate_t t; size_t n; - memset (&t, '\0', sizeof (t)); /* In initial state. */ +/*@-boundswrite@*/ + memset ((void *)&t, '\0', sizeof (t)); /* In initial state. */ +/*@=boundswrite@*/ /* Determine number of characters. */ n = mbsrtowcs (NULL, &scopy, strlen(scopy), &t); len += sizeof("=")-1 + n; |