Age | Commit message (Collapse) | Author | Files | Lines |
|
Use mkstemps() to safely create a unique temporary file instead of using
rand() to manually create a (potentially unsafe) temporary filename.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Include cpp.h for the prototype of cpp_exec() in order to fix the
following sparse warning:
cpp.c:18:5: warning: symbol 'cpp_exec' was not declared. Should it be static?
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Pass argv as char *const argv[] as execvp expects it.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Extend cpp_exec function with args parameter to
specify additional cpp options (like -D).
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Replace 'system' call by proc_exec function from proc.c
module. It allows to easy extend cpp invoking with additional
options (like -D) in more secure way.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
There might be a case when input file is located
in read-only directory and cpp fails when it tries to
create output file there, so use /tmp folder for that
as usually it should be writeable for any user.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
Add cpp_exec func to invoke C preprocessor
which allow to change the logic in one place only.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|