From c462509adfd68e8b849b8a6713360fb4f9026578 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 10 Apr 2025 02:00:58 +0300 Subject: fixed formatting of the smallest possible integer * In other words, fixed `-9223372036854775808\` on --with-teco-integer=64 (which is the default). * The reason is that ABS(G_MININT64) == G_MININT64 since -G_MININT64 == G_MININT64. It is therefore important not to call ABS() on arbitrary teco_int_t's. --- src/view.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/view.c') diff --git a/src/view.c b/src/view.c index df09aac..71d74e2 100644 --- a/src/view.c +++ b/src/view.c @@ -612,6 +612,7 @@ teco_view_glyphs2bytes_relative(teco_view_t *ctx, gsize pos, teco_int_t n) { if (!n) return pos; + /* NOTE: Does not work for n == G_MININT64. */ if (ABS(n) > TECO_RELATIVE_LIMIT) return teco_view_glyphs2bytes(ctx, teco_view_bytes2glyphs(ctx, pos) + n); -- cgit v1.2.3