On 26.5.2023 9.19, NRK wrote:> `system` is a function that should never
be used unless the person is
> aware of all the shell shenanigans that can bite back. The above is an
> extreme example, but *any* character that has special meaning to shell
> can cause problems.
>
> You should instead look into exec and/or posix_spawn functions before
> going any further.
Yes, this, system() is most of the time both the wrong way and the hard
way. Created a PR[0] to demonstrate how to use posix_spawnp() instead.
Also, as a sidenote; there is no C--, there's nothing -- about C.
[0]:
https://github.com/equwal/swallow-c--/pull/2
--
Santtu
Received on Fri May 26 2023 - 12:23:43 CEST