diff options
author | jbj <devnull@localhost> | 2002-07-02 23:54:35 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-07-02 23:54:35 +0000 |
commit | e5fb770e7d9aac53a513965c0f2bcf360934794b (patch) | |
tree | d8d581ec8f694a4811172b401e4dcda68898954a /popt | |
parent | 77076c7c8d83f8b783634c7328b132b938389987 (diff) | |
download | rpm-e5fb770e7d9aac53a513965c0f2bcf360934794b.tar.gz rpm-e5fb770e7d9aac53a513965c0f2bcf360934794b.tar.bz2 rpm-e5fb770e7d9aac53a513965c0f2bcf360934794b.zip |
Add boundsread annotations throughout, enable +bounds checking.
Start narrowing the scope of bounds annotations by adding more annotations.
CVS patchset: 5537
CVS date: 2002/07/02 23:54:35
Diffstat (limited to 'popt')
-rw-r--r-- | popt/.lclintrc | 3 | ||||
-rw-r--r-- | popt/popt.c | 2 | ||||
-rw-r--r-- | popt/popthelp.c | 4 | ||||
-rw-r--r-- | popt/test1.c | 2 |
4 files changed, 9 insertions, 2 deletions
diff --git a/popt/.lclintrc b/popt/.lclintrc index a3d22bc31..49aac9764 100644 --- a/popt/.lclintrc +++ b/popt/.lclintrc @@ -13,8 +13,7 @@ +strict # lclint level # --- in progress -#+bounds # 56 -+boundswrite # 40 ++bounds # --- +partial artifacts -exportlocal # 14 diff --git a/popt/popt.c b/popt/popt.c index e4d6d31a0..d2dffa715 100644 --- a/popt/popt.c +++ b/popt/popt.c @@ -335,8 +335,10 @@ static int handleAlias(/*@special@*/ poptContext con, if ((con->os - con->optionStack + 1) == POPT_OPTION_DEPTH) return POPT_ERROR_OPTSTOODEEP; +/*@-boundsread@*/ if (nextCharArg && *nextCharArg) con->os->nextCharArg = nextCharArg; +/*@=boundsread@*/ con->os++; con->os->next = 0; diff --git a/popt/popthelp.c b/popt/popthelp.c index 5f9d54f54..801dca5ac 100644 --- a/popt/popthelp.c +++ b/popt/popthelp.c @@ -325,6 +325,7 @@ static void singleOptionHelp(FILE * fp, int maxLeftCol, } helpLength = strlen(help); +/*@-boundsread@*/ while (helpLength > lineLength) { const char * ch; char format[10]; @@ -343,6 +344,7 @@ static void singleOptionHelp(FILE * fp, int maxLeftCol, while (isspace(*help) && *help) help++; helpLength = strlen(help); } +/*@=boundsread@*/ if (helpLength) fprintf(fp, "%s\n", help); @@ -479,9 +481,11 @@ static int showHelpIntro(poptContext con, FILE * fp) fprintf(fp, POPT_("Usage:")); if (!(con->flags & POPT_CONTEXT_KEEP_FIRST)) { +/*@-boundsread@*/ /*@-nullderef@*/ /* LCL: wazzup? */ fn = con->optionStack->argv[0]; /*@=nullderef@*/ +/*@=boundsread@*/ if (fn == NULL) return len; if (strchr(fn, '/')) fn = strrchr(fn, '/') + 1; fprintf(fp, " %s", fn); diff --git a/popt/test1.c b/popt/test1.c index d1bbc4728..8d84144df 100644 --- a/popt/test1.c +++ b/popt/test1.c @@ -254,6 +254,7 @@ int main(int argc, const char ** argv) if (singleDash) fprintf(stdout, " -"); +/*@-boundsread@*/ rest = poptGetArgs(optCon); if (rest) { fprintf(stdout, " rest:"); @@ -262,6 +263,7 @@ int main(int argc, const char ** argv) rest++; } } +/*@=boundsread@*/ fprintf(stdout, "\n"); |