diff options
| author | cremno <[email protected]> | 2015-04-29 16:41:45 +0200 |
|---|---|---|
| committer | cremno <[email protected]> | 2015-04-29 16:41:45 +0200 |
| commit | aaf2615ed60df6bd066aa60ac9c3aa9f021308b4 (patch) | |
| tree | 2103df7507df7496b808617566d76fc3fe483b29 /src/load.c | |
| parent | 4a82b9391a54ad6d99339485f1a827e29e0c4750 (diff) | |
| download | mruby-aaf2615ed60df6bd066aa60ac9c3aa9f021308b4.tar.gz mruby-aaf2615ed60df6bd066aa60ac9c3aa9f021308b4.zip | |
remove SIZE_ERROR() macro
It's only used once and in that case it isn't necessary anyway, since
size_t must be at least 32 bits wide and
the max. length of a filename is UINT16_MAX.
Diffstat (limited to 'src/load.c')
| -rw-r--r-- | src/load.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/load.c b/src/load.c index 9c4e777fc..9961bca6c 100644 --- a/src/load.c +++ b/src/load.c @@ -26,10 +26,8 @@ #if SIZE_MAX < UINT32_MAX # define SIZE_ERROR_MUL(x, y) ((x) > SIZE_MAX / (y)) -# define SIZE_ERROR(x) ((x) > SIZE_MAX) #else # define SIZE_ERROR_MUL(x, y) (0) -# define SIZE_ERROR(x) (0) #endif static size_t @@ -239,9 +237,6 @@ read_lineno_record_1(mrb_state *mrb, const uint8_t *bin, mrb_irep *irep, size_t fname_len = bin_to_uint16(bin); bin += sizeof(uint16_t); *len += sizeof(uint16_t); - if (SIZE_ERROR(fname_len + 1)) { - return MRB_DUMP_GENERAL_FAILURE; - } fname = (char *)mrb_malloc(mrb, fname_len + 1); memcpy(fname, bin, fname_len); fname[fname_len] = '\0'; @@ -667,7 +662,6 @@ mrb_read_irep_file(mrb_state *mrb, FILE* fp) return NULL; } - /* You don't need use SIZE_ERROR as buf_size is enough small. */ buf = (uint8_t*)mrb_malloc(mrb, header_size); if (fread(buf, header_size, 1, fp) == 0) { mrb_free(mrb, buf); |
