summaryrefslogtreecommitdiff
path: root/source/luametatex/source/tex/texprinting.c
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2022-12-05 23:11:09 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2022-12-05 23:11:09 +0100
commit265ba2a85e0945a37972e22f23bcaac16d6c08a1 (patch)
tree356963c1df5c5ed8a6189eeb3346970081a29af4 /source/luametatex/source/tex/texprinting.c
parent08fa92c1c94d9faddee48590a1a20506e89c191c (diff)
downloadcontext-265ba2a85e0945a37972e22f23bcaac16d6c08a1.tar.gz
2022-12-05 18:51:00
Diffstat (limited to 'source/luametatex/source/tex/texprinting.c')
-rw-r--r--source/luametatex/source/tex/texprinting.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/luametatex/source/tex/texprinting.c b/source/luametatex/source/tex/texprinting.c
index 860ff6731..d18445f36 100644
--- a/source/luametatex/source/tex/texprinting.c
+++ b/source/luametatex/source/tex/texprinting.c
@@ -465,15 +465,22 @@ void tex_print_str_esc(const char *s)
void tex_print_int(int n)
{
/*tex In the end a 0..9 fast path works out best; using |sprintf| is slower. */
+ if (n < 0) {
+ tex_print_char('-');
+ n = -n;
+ }
if (n >= 0 && n <= 9) {
tex_print_char('0' + n);
+ } else if (n >= 0 && n <= 99) {
+ tex_print_char('0' + n/10);
+ tex_print_char('0' + n%10);
} else {
int k = 0;
unsigned char digits[24];
- if (n < 0) {
- tex_print_char('-');
- n = -n;
- }
+// if (n < 0) {
+// tex_print_char('-');
+// n = -n;
+// }
do {
digits[k] = '0' + (unsigned char) (n % 10);
n = n / 10;