projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6c7a5b
)
Slightly simplify creating an ident from a string on an obstack.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Sat, 15 Nov 2008 13:20:05 +0000
(13:20 +0000)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Sat, 15 Nov 2008 13:20:05 +0000
(13:20 +0000)
[r23681]
mangle.c
patch
|
blob
|
history
diff --git
a/mangle.c
b/mangle.c
index
e83bcb3
..
50075ce
100644
(file)
--- a/
mangle.c
+++ b/
mangle.c
@@
-253,12
+253,10
@@
ident *create_name_linux_elf(entity_t *entity)
if (needs_mangling) {
mangle_entity(entity);
- obstack_1grow(&obst, '\0');
- char *str = obstack_finish(&obst);
-
- ident *id = new_id_from_str(str);
+ size_t size = obstack_object_size(&obst);
+ char *str = obstack_finish(&obst);
+ ident *id = new_id_from_chars(str, size);
obstack_free(&obst, str);
-
return id;
}