Allow an output indentation of zero in apps.
authorPauli <paul.dale@oracle.com>
Thu, 29 Aug 2019 05:21:04 +0000 (15:21 +1000)
committerPauli <paul.dale@oracle.com>
Thu, 29 Aug 2019 05:22:35 +0000 (15:22 +1000)
Previously, it would indent one space even if zero were specified.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9725)

apps/lib/app_params.c
apps/provider.c

index 6419f476da93ea84578d831979ecb3d12792c583..ba507079264c4f1148ea13d3a1c570a88602e1d8 100644 (file)
@@ -75,20 +75,20 @@ static int describe_param_type(char *buf, size_t bufsz, const OSSL_PARAM *param)
 int print_param_types(const char *thing, const OSSL_PARAM *pdefs, int indent)
 {
     if (pdefs == NULL) {
-        BIO_printf(bio_out, "%*sNo declared %s\n", indent, " ", thing);
+        BIO_printf(bio_out, "%*sNo declared %s\n", indent, "", thing);
     } else if (pdefs->key == NULL) {
         /*
          * An empty list?  This shouldn't happen, but let's just make sure to
          * say something if there's a badly written provider...
          */
-        BIO_printf(bio_out, "%*sEmpty list of %s (!!!)\n", indent, " ", thing);
+        BIO_printf(bio_out, "%*sEmpty list of %s (!!!)\n", indent, "", thing);
     } else {
-        BIO_printf(bio_out, "%*s%s:\n", indent, " ", thing);
+        BIO_printf(bio_out, "%*s%s:\n", indent, "", thing);
         for (; pdefs->key != NULL; pdefs++) {
             char buf[200];       /* This should be ample space */
 
             describe_param_type(buf, sizeof(buf), pdefs);
-            BIO_printf(bio_out, "%*s  %s\n", indent, " ", buf);
+            BIO_printf(bio_out, "%*s  %s\n", indent, "", buf);
         }
     }
     return 1;
index 33f194c33226041ef9ddbc9ff9dadae164bb3700..932bc40931aa1b12548ed326d96a00004f49f09a 100644 (file)
@@ -68,13 +68,13 @@ static void print_caps(META *meta, INFO *info)
         if (meta->first) {
             if (meta->total > 0)
                 BIO_printf(bio_out, "\n");
-            BIO_printf(bio_out, "%*s%ss:", meta->indent, " ", meta->label);
+            BIO_printf(bio_out, "%*s%ss:", meta->indent, "", meta->label);
         }
         BIO_printf(bio_out, " %s", info->name);
         break;
     case 3:
     default:
-        BIO_printf(bio_out, "%*s%s %s\n", meta->indent, " ", meta->label,
+        BIO_printf(bio_out, "%*s%s %s\n", meta->indent, "", meta->label,
                    info->name);
         print_param_types("retrievable algorithm parameters",
                           info->gettable_params, meta->subindent);