rust/cargo-c: update to 0.10.9+cargo-0.85.0
[oi-userland.git] / components / sysutils / top / patches / 07.itoa-fix-long.patch
blob8890d702a8c5533dbfdba2098a9a59de0da75999
1 diff -ur top-3.8beta1/display.c top-3.8beta1-p/display.c
2 --- top-3.8beta1/display.c 2016-10-04 15:11:26.584585961 +0300
3 +++ top-3.8beta1-p/display.c 2016-10-04 15:11:23.456363934 +0300
4 @@ -635,7 +635,7 @@
6 else
8 - display_write(x, y, color, 0, itoa((int)num));
9 + display_write(x, y, color, 0, itoa(num));
12 /* next iteration will not start at x, y */
13 diff -ur top-3.8beta1/utils.c top-3.8beta1-p/utils.c
14 --- top-3.8beta1/utils.c 2008-05-07 07:41:39.000000000 +0400
15 +++ top-3.8beta1-p/utils.c 2016-10-04 15:12:54.413001306 +0300
16 @@ -93,27 +93,27 @@
20 - * itoa - convert integer (decimal) to ascii string for positive numbers
21 + * itoa - convert integer (long) to ascii string for positive numbers
22 * only (we don't bother with negative numbers since we know we
23 * don't use them).
27 - * How do we know that 16 will suffice?
28 + * How do we know that 24 will suffice?
29 * Because the biggest number that we will
30 - * ever convert will be 2^32-1, which is 10
31 + * ever convert will be 2^64-1, which is 20
32 * digits.
35 char *
36 -itoa(int val)
37 +itoa(long val)
40 register char *ptr;
41 - static char buffer[16]; /* result is built here */
42 - /* 16 is sufficient since the largest number
43 - we will ever convert will be 2^32-1,
44 - which is 10 digits. */
45 + static char buffer[24]; /* result is built here */
46 + /* 24 is sufficient since the largest number
47 + we will ever convert will be 2^64-1,
48 + which is 20 digits. */
50 ptr = buffer + sizeof(buffer);
51 *--ptr = '\0';
52 diff -ur top-3.8beta1/utils.h top-3.8beta1-p/utils.h
53 --- top-3.8beta1/utils.h 2008-05-07 07:41:39.000000000 +0400
54 +++ top-3.8beta1-p/utils.h 2016-10-04 15:11:23.451063067 +0300
55 @@ -40,7 +40,7 @@
56 #define _UTILS_H
58 int atoiwi(char *);
59 -char *itoa(int);
60 +char *itoa(long);
61 char *itoa_w(int, int);
62 char *itoa7(int);
63 int digits(int);