Skip to content

Commit 1c728bd

Browse files
committed
lib/format.c: implement tostrmode()
1 parent ad4d211 commit 1c728bd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/format.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,9 +671,13 @@ humanize(const struct humanize *h, const struct xbps_fmt *fmt, int64_t d, FILE *
671671
}
672672

673673
static int
674-
tostrmode(const struct xbps_fmt *fmt UNUSED, int64_t d UNUSED, FILE *fp UNUSED)
674+
tostrmode(const struct xbps_fmt *fmt, int64_t d, FILE *fp)
675675
{
676-
return -ENOTSUP;
676+
char buf[64] = "";
677+
int len;
678+
xbps_strmode(d, buf);
679+
len = strlen(buf);
680+
return xbps_fmt_print_string(fmt, buf, len, fp);
677681
}
678682

679683
int

0 commit comments

Comments
 (0)