summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mpls.h4
-rw-r--r--lib/termtable.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/mpls.h b/lib/mpls.h
index 6cf0142755..c963e55087 100644
--- a/lib/mpls.h
+++ b/lib/mpls.h
@@ -40,6 +40,10 @@
#define MPLS_MIN_UNRESERVED_LABEL 16
#define MPLS_MAX_UNRESERVED_LABEL 1048575
+/* Default min and max SRGB label range */
+#define MPLS_DEFAULT_MIN_SRGB_LABEL 16000
+#define MPLS_DEFAULT_MAX_SRGB_LABEL 23999
+
#define IS_MPLS_RESERVED_LABEL(label) \
(label >= MPLS_MIN_RESERVED_LABEL && label <= MPLS_MAX_RESERVED_LABEL)
diff --git a/lib/termtable.c b/lib/termtable.c
index fb16e5dba1..283fa173d8 100644
--- a/lib/termtable.c
+++ b/lib/termtable.c
@@ -123,15 +123,13 @@ static struct ttable_cell *ttable_insert_row_va(struct ttable *tt, int i,
assert(i >= -1 && i < tt->nrows);
char *res, *orig, *section;
- const char *f;
struct ttable_cell *row;
int col = 0;
int ncols = 0;
/* count how many columns we have */
- f = format;
- for (; f[ncols]; f[ncols] == '|' ? ncols++ : *f++)
- ;
+ for (int i = 0; format[i]; i++)
+ ncols += !!(format[i] == '|');
ncols++;
if (tt->ncols == 0)
@@ -338,7 +336,7 @@ char *ttable_dump(struct ttable *tt, const char *newline)
/* calculate number of lines en total */
nlines = tt->nrows;
nlines += tt->style.border.top_on ? 1 : 0;
- nlines += tt->style.border.bottom_on ? 1 : 1; // makes life easier
+ nlines += 1; // tt->style.border.bottom_on ? 1 : 1; makes life easier
for (int i = 0; i < tt->nrows; i++) {
/* if leftmost cell has top / bottom border, whole row does */
nlines += tt->table[i][0].style.border.top_on ? 1 : 0;