Thema: c progamm
Einzelnen Beitrag anzeigen
Alt 25.01.2006, 17:51   #1
Smokey
Veteran
 
Registriert seit: 28.05.2003
Alter: 41
Beiträge: 208


Smokey eine Nachricht über ICQ schicken
Standard c progamm

die funktion funktioniert wenn ich sie einmal aufrufe..

sobald sie aber zwei mal aufgerufen wird gibts einen speicherzugriffsfehler.

hat irgendwer eine ahnung woran das liegen könnte?

mfg smokey

PHP-Code:
int checkip(char *ip)
{
int count=0;
int ts1ts2;
struct timeb ts;
FILE *logfile;
char *puffer;
char *iplog;
int ret=0;

logfile fopen("log.dat","r");

ftime(&ts); 

while (
fread(&puffer11logfile)>0)
{
    if(
strcmp(&puffer,":"))
        
strncat(iplog,&puffer,1);
        
    else
    {
        if(!
strcmp(iplog,ip))
        {    
            
fread(&puffer101logfile);
            break;
        }
        
//printf("Gesperrt");
    
strcpy(iplog,"");
    }
}

ts1 convint(&puffer);
ftime(&ts); 
ts2 ts.time;
ts1 ts2-ts1;

if(
ts1 1800)
ret=1;

fclose(logfile);
return 
ret;

Smokey ist offline   Mit Zitat antworten