mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
remove malloc casting
This commit is contained in:
parent
a0c06d0843
commit
1cf9654368
|
@ -2332,7 +2332,7 @@ static char *parseargs(char *cmd, char **argv, int *pindex)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
size_t len = xstrlen(cmd) + 1;
|
size_t len = xstrlen(cmd) + 1;
|
||||||
char *line = (char *)malloc(len);
|
char *line = malloc(len);
|
||||||
|
|
||||||
if (!line) {
|
if (!line) {
|
||||||
DPRINTF_S("malloc()!");
|
DPRINTF_S("malloc()!");
|
||||||
|
@ -8562,8 +8562,8 @@ static bool setup_config(void)
|
||||||
if (!xdg)
|
if (!xdg)
|
||||||
len = xstrlen(home) + xstrlen("/.config/nnn/bookmarks") + 1;
|
len = xstrlen(home) + xstrlen("/.config/nnn/bookmarks") + 1;
|
||||||
|
|
||||||
cfgpath = (char *)malloc(len);
|
cfgpath = malloc(len);
|
||||||
plgpath = (char *)malloc(len);
|
plgpath = malloc(len);
|
||||||
if (!cfgpath || !plgpath) {
|
if (!cfgpath || !plgpath) {
|
||||||
xerror();
|
xerror();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -8601,7 +8601,7 @@ static bool setup_config(void)
|
||||||
char *env_sel = xgetenv(env_cfg[NNN_SEL], NULL);
|
char *env_sel = xgetenv(env_cfg[NNN_SEL], NULL);
|
||||||
|
|
||||||
selpath = env_sel ? xstrdup(env_sel)
|
selpath = env_sel ? xstrdup(env_sel)
|
||||||
: (char *)malloc(len + 3); /* Length of "/.config/nnn/.selection" */
|
: malloc(len + 3); /* Length of "/.config/nnn/.selection" */
|
||||||
|
|
||||||
if (!selpath) {
|
if (!selpath) {
|
||||||
xerror();
|
xerror();
|
||||||
|
|
Loading…
Reference in a new issue