Commit c219c2a1 authored by cremno's avatar cremno

use RITE_LV_NULL_MARK for better readability

The comment didn't say why the length is reserved.
Using RITE_LV_NULL_MARK makes things a bit clearer.
parent 0e28f4b9
......@@ -9,6 +9,7 @@
#include "mruby.h"
#include "mruby/khash.h"
#include "mruby/string.h"
#include "mruby/dump.h"
/* ------------------------------------------------------ */
typedef struct symbol_name {
......@@ -38,7 +39,7 @@ KHASH_DEFINE (n2s, symbol_name, mrb_sym, TRUE, sym_hash_func, sym_hash_equal)
static void
sym_validate_len(mrb_state *mrb, size_t len)
{
if (len > (UINT16_MAX-1)) { /* UINT16_MAX is reverved */
if (len >= RITE_LV_NULL_MARK) {
mrb_raise(mrb, E_ARGUMENT_ERROR, "symbol length too long");
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment