Aca te dejo el codigo con algunas modificaciones, por lo menos en la ejecucion anda todo bien!
Lo que si, para usar la funcion execl(), tengo entendido que tenes que incluir la libreria unistd.h (no se si sera asi en Windows).
#include <stdio.h>
#include <string.h>
int
main( void )
{
char bufferealm[40];
FILE *pf;
pf = fopen( "Realmlist.wtf", "r+" );
if ( pf == NULL )
{
printf( "No has configurado WEL debes ejecutar el archivo Configure.exe" );
return -1;
}
while ( fgets( bufferealm, 40, pf ) != NULL )
{
char buffer[50];
bufferealm[strlen( bufferealm ) - 1] = '\0';
sprintf( buffer, "ping -w 4 %s", bufferealm );
if ( system( buffer ) == 0 )
{
FILE *df = fopen( "realmlist.wtf", "w" );
if ( df != NULL )
{
char buffertres[50];
sprintf( buffertres, "set realmlist %s", bufferealm );
fprintf( df, "%s", buffertres );
printf( "------------------------------------------------------\n"
"------------------------------------------------------\n"
"%s esta encendido y el realmlist ya esta cambiado\n", bufferealm );
printf( "Lanzando paginas de votos...\n" );
//system( "firefox http://www.google.es" );
//system( "firefox http://www.google.es" );
printf( "------------------------------------------------------\n"
"------------------------------------------------------\n"
"Lanzando World Of Warcraft\n" );
//execl( "C:\\Archivos de prorgama\\World of Warcraft\\Wow.exe", "Wow.exe", 0 );
return 0;
}
else
return -1;
}
else
printf( "%s se encuentra apagado WEL pasara al siguiente realmlist\n\n\n", bufferealm );
}
}
Ejecucion del programa...
./Main
ping: unknown host exirn.servegame.com
exirn.servegame.com se encuentra apagado WEL pasara al siguiente realmlist
PING wowsulvus.no-ip.biz (94.23.240.155) 56(84) bytes of data.
64 bytes from ns209133.ovh.net (94.23.240.155): icmp_seq=1 ttl=52 time=277 ms
64 bytes from ns209133.ovh.net (94.23.240.155): icmp_seq=2 ttl=52 time=276 ms
64 bytes from ns209133.ovh.net (94.23.240.155): icmp_seq=3 ttl=52 time=277 ms
64 bytes from ns209133.ovh.net (94.23.240.155): icmp_seq=4 ttl=52 time=278 ms
--- wowsulvus.no-ip.biz ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3003ms
rtt min/avg/max/mdev = 276.769/277.876/278.838/0.735 ms
------------------------------------------------------
------------------------------------------------------
wowsulvus.no-ip.biz esta encendido y el realmlist ya esta cambiado
Lanzando paginas de votos...
------------------------------------------------------
------------------------------------------------------
Lanzando World Of Warcraft
Realmlist.wtf
exirn.servegame.com
wowsulvus.no-ip.biz
realmlist.wtf
set realmlist wowsulvus.no-ip.biz
Salu10.