mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Copy to *lenp just in case lenp != NULL.
This commit is contained in:
+6
-2
@@ -83,12 +83,16 @@ mrb_sym2name_len(mrb_state *mrb, mrb_sym sym, int *lenp)
|
||||
if (kh_exist(h, k)) {
|
||||
if (kh_value(h, k) == sym) {
|
||||
sname = kh_key(h, k);
|
||||
*lenp = sname.len;
|
||||
if (lenp) {
|
||||
*lenp = sname.len;
|
||||
}
|
||||
return sname.name;
|
||||
}
|
||||
}
|
||||
}
|
||||
*lenp = 0;
|
||||
if (lenp) {
|
||||
*lenp = 0;
|
||||
}
|
||||
return NULL; /* missing */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user