nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e43a2bf
)
lib/standard/string: Fixed bug in to_s implementations in NativeString
author
Lucas Bajolet
<r4pass@hotmail.com>
Tue, 4 Nov 2014 20:43:18 +0000
(15:43 -0500)
committer
Lucas Bajolet
<r4pass@hotmail.com>
Tue, 4 Nov 2014 20:44:27 +0000
(15:44 -0500)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
lib/standard/string.nit
patch
|
blob
|
history
diff --git
a/lib/standard/string.nit
b/lib/standard/string.nit
index
0529b60
..
ba41bf9
100644
(file)
--- a/
lib/standard/string.nit
+++ b/
lib/standard/string.nit
@@
-2050,7
+2050,6
@@
extern class NativeString `{ char* `}
do
assert length >= 0
var str = new FlatString.with_infos(self, length, 0, length - 1)
- str.real_items = self
return str
end
@@
-2060,7
+2059,8
@@
extern class NativeString `{ char* `}
var new_self = calloc_string(length + 1)
copy_to(new_self, length, 0, 0)
var str = new FlatString.with_infos(new_self, length, 0, length - 1)
- str.real_items = self
+ new_self[length] = '\0'
+ str.real_items = new_self
return str
end
end