diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-05-10 20:10:24 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-05-11 15:55:54 -0400 |
| commit | 9df56118210af2ae0af8d735e85b391828b5d289 (patch) | |
| tree | 5467824b08d8b3fa6aa9a695f1835d3689902a89 /src/cli | |
| parent | 398c71a07c84312d7438974d178a0358d3713e2b (diff) | |
| download | stasis-9df56118210af2ae0af8d735e85b391828b5d289.tar.gz | |
How did you get back in there...
Diffstat (limited to 'src/cli')
| -rw-r--r-- | src/cli/stasis/stasis_main.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/cli/stasis/stasis_main.c b/src/cli/stasis/stasis_main.c index 553d275..fb4ed80 100644 --- a/src/cli/stasis/stasis_main.c +++ b/src/cli/stasis/stasis_main.c @@ -522,40 +522,6 @@ static void transfer_artifacts(struct Delivery *ctx) { } } -static char *center_text(const char *s, const size_t maxwidth) { - if (maxwidth < 2) { - SYSERROR("maximum width must be greater than 0"); - return NULL; - } - - if (maxwidth % 2 != 0) { - SYSERROR("maximum width (%zu) must be even", maxwidth); - return NULL; - } - - const size_t s_len = strlen(s); - if (s_len + 1 > maxwidth) { - SYSERROR("length of input string (%zu) exceeds maximum width (%zu)", s_len, maxwidth); - return NULL; - } - - char *result = calloc(maxwidth + 1, sizeof(*result)); - if (!result) { - SYSERROR("unable to allocate bytes for centered text string"); - return NULL; - } - const size_t middle = (maxwidth / 2) - s_len / 2; - size_t i = 0; - for (; i < middle; i++) { - result[i] = ' '; - } - result[i++] = 'v'; - strncpy(&result[i], s, maxwidth - middle - 1); - result[maxwidth] = '\0'; - - return result; -} - int main(int argc, char *argv[]) { struct Delivery ctx; struct Process proc = { |
