Tell core that we want to have this packet delivered
[oweals/gnunet.git] / src / util / getopt_helpers.c
index 3aea5d102af6455524c5cdab70e988a2b4c6cfc5..746dc526727d3e9a5b288a76f379bf6be9e65ea1 100644 (file)
@@ -50,11 +50,11 @@ GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
                             const char *value)
 {
   const char *about = scls;
-  int slen;
-  int i;
+  size_t slen;
+  unsigned int i;
   int j;
-  int ml;
-  int p;
+  size_t ml;
+  size_t p;
   char *scp;
   const char *trans;
   const struct GNUNET_GETOPT_CommandLineOption *opt;
@@ -62,7 +62,6 @@ GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
   printf ("%s\n%s\n", ctx->binaryOptions, gettext (about));
   printf (_
           ("Arguments mandatory for long options are also mandatory for short options.\n"));
-  slen = 0;
   i = 0;
   opt = ctx->allOptions;
   while (opt[i].description != NULL)
@@ -85,10 +84,13 @@ GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
         }
       if (slen < BORDER)
         {
-          printf ("%*s", BORDER - slen, "");
+          printf ("%*s", (int) (BORDER - slen), "");
           slen = BORDER;
         }
-      trans = gettext (opt[i].description);
+      if (0 < strlen (opt[i].description))
+       trans = gettext (opt[i].description);
+      else
+       trans = "";
       ml = strlen (trans);
       p = 0;
     OUTER:
@@ -96,7 +98,7 @@ GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
         {
           for (j = p + 78 - slen; j > p; j--)
             {
-              if (isspace (trans[j]))
+              if (isspace ( (unsigned char) trans[j]))
                 {
                   scp = GNUNET_malloc (j - p + 1);
                   memcpy (scp, &trans[p], j - p);