summaryrefslogtreecommitdiff
path: root/components/libc/compilers/common/cstdlib.c
diff options
context:
space:
mode:
authorTangyuxin <[email protected]>2022-09-20 22:31:11 +0800
committerGitHub <[email protected]>2022-09-20 10:31:11 -0400
commita4829b1c004015cca489679cc335b6089aa9da31 (patch)
tree3e346e76bb1c77b5b189ca28b053daeaea5154e9 /components/libc/compilers/common/cstdlib.c
parent746d7a01bdb29c692b696780f938f11253ae1103 (diff)
[fix] Fix simulator compilation warnings (#6438)
* [fix] Fix simulator compilation warnings * Update bsp/simulator/rtconfig_project.h Co-authored-by: Man, Jianting (Meco) <[email protected]>
Diffstat (limited to 'components/libc/compilers/common/cstdlib.c')
-rw-r--r--components/libc/compilers/common/cstdlib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/libc/compilers/common/cstdlib.c b/components/libc/compilers/common/cstdlib.c
index 55263011a9..4a978a106c 100644
--- a/components/libc/compilers/common/cstdlib.c
+++ b/components/libc/compilers/common/cstdlib.c
@@ -84,9 +84,9 @@ char *ltoa(long value, char *string, int radix)
i = v % radix;
v = v / radix;
if (i < 10)
- *tp++ = i+'0';
+ *tp++ = (char)(i+'0');
else
- *tp++ = i + 'a' - 10;
+ *tp++ = (char)(i + 'a' - 10);
}
sp = string;
@@ -129,9 +129,9 @@ char *ultoa(unsigned long value, char *string, int radix)
i = v % radix;
v = v / radix;
if (i < 10)
- *tp++ = i+'0';
+ *tp++ = (char)(i+'0');
else
- *tp++ = i + 'a' - 10;
+ *tp++ = (char)(i + 'a' - 10);
}
sp = string;