Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sobomax committed Oct 3, 2024
1 parent 1b465fa commit b6ba893
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/rtp.io/rtp_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ static int mod_init(void)


int argc;
char **argv = rtp_io_env_gen_argv(&rpi_descp->env, &argc);
const char *const *argv = rtp_io_env_gen_argv(&rpi_descp->env, &argc);
if (argv == NULL)
goto e1;

OPT_RESTORE();
rpi_descp->rtpp_cfsp = rtpp_main(argc, argv);
free(argv);
free((void *)argv);
if (rpi_descp->rtpp_cfsp == NULL)
goto e1;

Expand Down
4 changes: 2 additions & 2 deletions modules/rtp.io/rtp_io_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ rtp_io_env_append(struct rtpp_env_hd *ecp, struct rtpp_env *ep)
ecp->len += 1;
}

char **
const char *const *
rtp_io_env_gen_argv(struct rtpp_env_hd *ecp, int *lenp)
{
char **rval;
Expand All @@ -59,5 +59,5 @@ rtp_io_env_gen_argv(struct rtpp_env_hd *ecp, int *lenp)
ep = ep->next;
}
*lenp = ecp->len;
return rval;
return (const char *const *)rval;
}
4 changes: 3 additions & 1 deletion modules/rtp.io/rtp_io_util.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#pragma once

struct rtpp_env;
struct rtpp_env_hd;

struct rtpp_env *rtp_io_env_asprintf(const char *, ...);

void rtp_io_env_append(struct rtpp_env_hd *, struct rtpp_env *);
char ** rtp_io_env_gen_argv(struct rtpp_env_hd *, int *);
const char *const * rtp_io_env_gen_argv(struct rtpp_env_hd *, int *);

0 comments on commit b6ba893

Please sign in to comment.