[PATCH 4/4] Introduce obstack_strndup

Tom Tromey tom@tromey.com
Wed Aug 7 02:04:00 GMT 2019


Kevin> I think the name (of obstack_strndup) is okay, though I do think that
Kevin> it might be worth noting that exactly N characters are duplicated in
Kevin> obstack_strndup's comment.  I.e, it won't be shorter if the string
Kevin> being copied happens to be shorter.

Kevin> It took me a while to realize that the "0" in obstack_copy0 /
Kevin> obstack_grow0 cause a '\0' character to be tacked onto the end.

Kevin> Anyway, aside from perhaps updating the comment for obstack_strndup, it
Kevin> looks good to me.

Thanks.  I've made this change & the other one you pointed out, and I'm
checking it in.

Tom



More information about the Gdb-patches mailing list