summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <jbj>2004-02-26 01:20:53 +0000
committerjbj <jbj>2004-02-26 01:20:53 +0000
commit005876837b0420120a5ae37e899baf88f1f1fa03 (patch)
tree8058bd5cea3bf2439d5193c096420e60a4ed6099
parenta8a222fef60fd0f5f9609d53d60ab3fe54a3a9c4 (diff)
downloadlibpopt-005876837b0420120a5ae37e899baf88f1f1fa03.tar.gz
splint fiddles.
-rw-r--r--popthelp.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/popthelp.c b/popthelp.c
index 872ea79..5f10a5f 100644
--- a/popthelp.c
+++ b/popthelp.c
@@ -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;