diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-06-06 15:05:35 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-06-06 15:05:35 -0400 |
| commit | e9abf8a370b0256f96108048eec95b68ef92effc (patch) | |
| tree | 5987fc28bc90605a7f6e6fa57fbc9da3b1d8deac /builtins/files.c | |
| parent | b4dc8587946d5300ae983c9c3cfc2d03f76ed746 (diff) | |
Prefer 'sizeof(t[n])' over 'sizeof(t)*n'
Diffstat (limited to 'builtins/files.c')
| -rw-r--r-- | builtins/files.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtins/files.c b/builtins/files.c index 524a8626..6c833469 100644 --- a/builtins/files.c +++ b/builtins/files.c @@ -93,7 +93,7 @@ static file_t *_load_file(const char* filename, FILE *file) int64_t line_len = 0; while ((line_len = getline(&line_buf, &line_cap, file)) >= 0) { if (ret->line_capacity <= ret->num_lines) - ret->line_offsets = GC_REALLOC(ret->line_offsets, sizeof(int64_t)*(ret->line_capacity += 32)); + ret->line_offsets = GC_REALLOC(ret->line_offsets, sizeof(int64_t[ret->line_capacity += 32])); ret->line_offsets[ret->num_lines++] = file_size; fwrite(line_buf, sizeof(char), line_len, mem); fflush(mem); |
