Repos / kernel.git / commitdiff
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7a78a3c)
raw | patch | inline | side by side (parent: 7a78a3c)
| author | zhaoyanbai <zhaoyanbai@126.com> | |
| Sat, 15 Aug 2026 00:42:14 +0000 (08:42 +0800) | ||
| committer | zhaoyanbai <zhaoyanbai@126.com> | |
| Sat, 15 Aug 2026 00:42:14 +0000 (08:42 +0800) |
| lib/string.c | patch | blob | history | |
| lib/vsprintf.c | patch | blob | history |
diff --git a/lib/string.c b/lib/string.c
--- a/lib/string.c
+++ b/lib/string.c
// ;
while (1) {
*dest = *src;
- dest++;
- src++;
if (*dest == 0) {
break;
}
+
+ dest++;
+ src++;
}
return tmp;
}
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
char* itou(char* s, unsigned int n) {
char* p = s;
+ char* h = s;
do {
*p++ = (n % 10) + '0';
n /= 10;
} while (n);
- *p-- = 0;
+ *p = 0;
+ p--;
- while (s < p) {
- swap_char(s, p);
- s++;
+ while (h < p) {
+ swap_char(h, p);
+ h++;
p--;
}
return s;