summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2024-12-17 21:50:00 -0500
committerAlan Wu <[email protected]>2024-12-17 21:50:00 -0500
commit6336431a64cac606ed8fa35ed577ba37755eccfc (patch)
tree1a2ef718d39855d52fc880441d2f49a7da8240c1 /include/ruby
parent827acccce7265538bb632f001eca90a050874bd8 (diff)
[DOC] rb_id2name(): Note truncation danger (+minor copyediting)
Thanks, nobu!
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/internal/symbol.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/ruby/internal/symbol.h b/include/ruby/internal/symbol.h
index 594652151a..3ffc5abc2b 100644
--- a/include/ruby/internal/symbol.h
+++ b/include/ruby/internal/symbol.h
@@ -121,10 +121,13 @@ ID rb_intern_str(VALUE str);
* Retrieves the name mapped to the given id.
*
* @param[in] id An id to query.
- * @retval NULL No such id ever existed in the history.
+ * @retval NULL Unknown id.
* @retval otherwise A name that the id represents.
* @note The return value is managed by the interpreter. Don't pass it
* to free().
+ * @note The underlying name can contain internal NUL bytes, so the return
+ * value might be a truncated representation due to the nature of C
+ * strings.
* @note This C string is backed by an underlying Ruby string. The Ruby
* string may move during GC compaction which would make this
* C string point to invalid memory. Do not use the return value