diff options
author | Michael McConville <mmcconville@mykolab.com> | 2015-12-08 21:00:39 -0500 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2015-12-09 09:48:39 -0500 |
commit | c53d722b0b4e81b08cfc2f9ff6675a7abe0de2c3 (patch) | |
tree | 4e19f81d30f1b2323c0a89a09c0d92359e713634 /src/main.c | |
parent | c03bef5411d3231f42445932d1971d656f020817 (diff) |
Removed flex_alloc; cleaned up style.
The function flex_alloc() was just a wrapper around malloc(). Since this only added unclarity, and the flex_alloc() function is likely a legacy of olden times, remove it in favor of calls to malloc() directly.
Style elements cleaned up:
* superfluous spacing around parentheses
* non-constant initialization in variable declarations
* needless casts
* almost all uses of assignments as subexpressions
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -448,7 +448,8 @@ void check_options (void) char *str, *fmt = "#define %s %d\n"; size_t strsz; - str = (char*)flex_alloc(strsz = strlen(fmt) + strlen(scname[i]) + (int)(1 + log10(i)) + 2); + strsz = strlen(fmt) + strlen(scname[i]) + (int)(1 + log10(i)) + 2; + str = malloc(strsz); if (!str) flexfatal(_("allocation of macro definition failed")); snprintf(str, strsz, fmt, scname[i], i - 1); |