We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d87c386 commit be3f5fcCopy full SHA for be3f5fc
src/lib/string.c
@@ -8,7 +8,7 @@
8
*/
9
char *itoa(int a) {
10
static char buf[30];
11
- char *p = buf + sizeof(buf);
+ char *p = buf + sizeof(buf) - 1;
12
do {
13
*--p = '0' + a % 10;
14
} while (a /= 10);
0 commit comments