Ya vi el bucle... la linea 21 lo provoca. Si llamas con el parametro malo, siempre sera el malo.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <signal.h>
#include <errno.h>
int main (int argc,char *argv[])
{
if(strcmp(argv
[1],"malo")==0)//Cambiar argv[0] por argv[1] {
switch(fork())
{
case -1:
perror("Error al crear al Malo\n"); case 0: //SOY EL MALO
if(execl("./prueba1","malo",NULL)==-1)
{
perror("Error al cambiar el proceso de nombre\n"); }
pause();
break;
default: //SOY CHARLIE
pause();
break;
}
}
return 0;
}