mirror of
https://github.com/cs341-illinois/coursebook.git
synced 2026-10-02 08:04:38 +08:00
Update processes.tex
This commit is contained in:
@@ -862,7 +862,8 @@ By allowing someone to access a shell version of the environment, the program ca
|
||||
|
||||
\begin{lstlisting}[language=C]
|
||||
int main(int argc, char**argv) {
|
||||
char *to_exec = asprintf("ls %s", argv[1]);
|
||||
char *to_exec;
|
||||
asprintf(&to_exec, "ls %s", argv[1]);
|
||||
system(to_exec);
|
||||
}
|
||||
\end{lstlisting}
|
||||
|
||||
Reference in New Issue
Block a user