summaryrefslogtreecommitdiff
path: root/popthelp.c
diff options
context:
space:
mode:
authorjbj <jbj>2008-02-17 00:53:49 +0000
committerjbj <jbj>2008-02-17 00:53:49 +0000
commitaeadef4096dd6a72fa84d419c172687777dc04c4 (patch)
tree5c9965256b912a0b9c252c6bd1fab5a019ba610f /popthelp.c
parent3f8ebb78d75a8b1c3c1a726418bb71fe2412aee4 (diff)
downloadlibpopt-aeadef4096dd6a72fa84d419c172687777dc04c4.tar.gz
- jbj: another pass with splint: use malloc, not alloca.
Diffstat (limited to 'popthelp.c')
-rw-r--r--popthelp.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/popthelp.c b/popthelp.c
index 2cc8c41..454c05e 100644
--- a/popthelp.c
+++ b/popthelp.c
@@ -10,8 +10,8 @@
#include "system.h"
-#define POPT_USE_TIOCGWINSZ
-#ifdef POPT_USE_TIOCGWINSZ
+#define POPT_USE_TIOCGWINSZ
+#ifdef POPT_USE_TIOCGWINSZ
#include <sys/ioctl.h>
#endif
@@ -20,8 +20,6 @@
#include <wchar.h> /* for mbsrtowcs */
/*@access mbstate_t @*/
#endif
-
-
#include "poptint.h"
/*@access poptContext@*/
@@ -99,21 +97,21 @@ static struct poptOption poptHelpOptions2[] = {
struct poptOption * poptHelpOptionsI18N = poptHelpOptions2;
/*@=castfcnptr@*/
-#define _POPTHELP_MAXLINE ((size_t)79)
+#define _POPTHELP_MAXLINE ((size_t)79)
typedef struct columns_s {
size_t cur;
size_t max;
} * columns_t;
-/**
+/**
* Return no. of columns in output window.
- * @param fp FILE
- * @return no. of columns
- */
+ * @param fp FILE
+ * @return no. of columns
+ */
static size_t maxColumnWidth(FILE *fp)
/*@*/
-{
+{
size_t maxcols = _POPTHELP_MAXLINE;
#if defined(TIOCGWINSZ)
struct winsize ws;
@@ -127,7 +125,7 @@ static size_t maxColumnWidth(FILE *fp)
}
#endif
return maxcols;
-}
+}
/**
* Determine number of display characters in a string.
@@ -190,8 +188,8 @@ getArgDescrip(const struct poptOption * opt,
/* Some strings need popt library, not application, i18n domain. */
if (opt == (poptHelpOptions + 1)
|| opt == (poptHelpOptions + 2)
- || !strcmp(opt->argDescrip,N_("Help options:"))
- || !strcmp(opt->argDescrip,N_("Options implemented via popt alias/exec:")))
+ || !strcmp(opt->argDescrip, N_("Help options:"))
+ || !strcmp(opt->argDescrip, N_("Options implemented via popt alias/exec:")))
return POPT_(opt->argDescrip);
/* Use the application i18n domain. */
@@ -459,7 +457,7 @@ static void singleOptionHelp(FILE * fp, columns_t columns,
ch = help + lineLength - 1;
while (ch > help && !_isspaceptr(ch))
- ch = POPT_prev_char (ch);
+ ch = POPT_prev_char(ch);
if (ch == help) break; /* give up */
while (ch > (help + 1) && _isspaceptr(ch))
ch = POPT_prev_char (ch);