summaryrefslogtreecommitdiff
path: root/popthelp.c
diff options
context:
space:
mode:
authorjbj <jbj>2015-05-13 13:09:27 +0000
committerjbj <jbj>2015-05-13 13:09:27 +0000
commit32d47de85df1a4d2a5467b0ca5a0d9e007ca000c (patch)
treeeddac16bf72e46102691fe3183dba367c3b6ce57 /popthelp.c
parentf59b34478bd4e00fada2dbc5b2299f7a0c4d1631 (diff)
downloadlibpopt-32d47de85df1a4d2a5467b0ca5a0d9e007ca000c.tar.gz
- cppcheck: annotate/fix warnings.
- resurrect make distcheck.
Diffstat (limited to 'popthelp.c')
-rw-r--r--popthelp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/popthelp.c b/popthelp.c
index ce7581f..4a1299a 100644
--- a/popthelp.c
+++ b/popthelp.c
@@ -55,6 +55,7 @@ static void displayArgs(poptContext con,
poptPrintUsage(con, stdout, 0);
#if !defined(__LCLINT__) /* XXX keep both splint & valgrind happy */
+ // cppcheck-suppress uselessAssignmentPtrArg
con = poptFreeContext(con);
#endif
exit(0);
@@ -484,7 +485,6 @@ assert(t); /* XXX can't happen */
helpLength = strlen(help);
while (helpLength > lineLength) {
const char * ch;
- char format[16];
ch = help + lineLength - 1;
while (ch > help && !_isspaceptr(ch))
@@ -500,6 +500,7 @@ assert(t); /* XXX can't happen */
*/
{ char * fmthelp = xstrdup(help);
if (fmthelp) {
+ char format[16];
fmthelp[ch - help] = '\0';
sprintf(format, "%%s\n%%%ds", (int) indentLength);
/*@-formatconst@*/