mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin : fix issue with int.hex
This commit is contained in:
parent
61c7fa073b
commit
32e32cee5c
@ -125,8 +125,8 @@ pub fn (b bool) str() string {
|
|||||||
pub fn (n int) hex() string {
|
pub fn (n int) hex() string {
|
||||||
s := n.str()
|
s := n.str()
|
||||||
hex := malloc(s.len + 3) // 0x + \n
|
hex := malloc(s.len + 3) // 0x + \n
|
||||||
C.sprintf(hex, '0x%x', n)
|
count := int(C.sprintf(hex, '0x%x', n))
|
||||||
return tos(hex, s.len + 3)
|
return tos(hex, count)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn (n i64) hex() string {
|
pub fn (n i64) hex() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user