support for left bounded padding in %H and %D
authorMartin Willi <martin@strongswan.org>
Fri, 9 May 2008 12:25:39 +0000 (12:25 -0000)
committerMartin Willi <martin@strongswan.org>
Fri, 9 May 2008 12:25:39 +0000 (12:25 -0000)
src/libstrongswan/utils/host.c
src/libstrongswan/utils/identification.c

index aab0f09..bde7dc1 100644 (file)
@@ -149,6 +149,10 @@ static int print(FILE *stream, const struct printf_info *info,
                                break;
                }
        }
+       if (info->left)
+       {
+               return fprintf(stream, "%-*s", info->width, buffer);
+       }
        return fprintf(stream, "%*s", info->width, buffer);
 }
 
index ae444b4..c06c806 100644 (file)
@@ -938,6 +938,10 @@ static int print(FILE *stream, const struct printf_info *info,
                        snprintf(buf, sizeof(buf), "(unknown ID type: %d)", this->type);
                        break;
        }
+       if (info->left)
+       {
+               return fprintf(stream, "%-*s", info->width, buf);
+       }
        return fprintf(stream, "%*s", info->width, buf);
 }