Segmentation. strcmp [C]
I have a file with format: [name][number][amount]
number is taken as a string. and im using it in a strcmp.
Problem is that i get a segmentation fault. I know that on most cases when strcmp signs segmentation fault it means that one of the parameters is null or cant find its "end" ('\0').
I checked with gdb and i cant say if this is the problem.Take a look:

    > (gdb) bt full
    > #0  0x08048729 in lookup (hashtable=0x804b008, hashval=27, 
    >     number=0x804b740 "6900101001") 
    >         list = 0xffffffff
    > #1  0x080487ac in add (hashtable=0x804b008, 
    >     number=0x804b740 "9900101001", name=0x804b730 "Smithpolow",
    > time=6943) 
    >         new_elem = 0xffffffff
    >         hashval = 27
    > #2  0x08048b25 in main (argc=1, argv=0xbffff4b4) 
    >         number = 0x804b740 "9900101001"
    >         name = 0x804b730 "Smithpolow"
    >         time = 6943
    >         i = 2


Code:

    clientsList *lookup_on_Clients(clientsHashTable *hashtable,int hashval,char number[10])
    {
     printf("NUMBER:%s\n",number);
     clientsList *list=hashtable[hashval].head;
     for(list; list!=NULL; list=list->next){
       if (strcmp(number,list->name)==0)   //SEGMENTATION!
        return list;
      
     }
     return NULL;
    }



and the main:

    FILE * File2;
        if ( ( File2=fopen(" File.txt","r")) !=NULL ) 
        { // File.txt format:  [name number time] e.g lountemis 6900254565 700651
            int li = 0;
            char *lin = (char *) malloc(MAX_LINE * sizeof(char));
      
            while(fgets(lin, MAX_LINE, clientFile2) != NULL)
            {
                token = my_linetok(lin, " ");
                if(token != NULL)
                {
      char* number ;
      char* name;
      int time;
      int i;
                    for(i = 0; token[i] != NULL; i++)
                    {
       name=strdup(token[0]);
       number=strdup(token[1]);
       time=atoi(token[2]);
        
       if (i==2)
       { int insertDone=0;
             insertDone =add(my_hash_table,number,name,time);   
        
       } 
      }
      free(name);
      free(token);
                }
                else 
         {
                    printf("Error reading line %s\n", lin);
                    exit(1);   
                }
            }
     
        } 
        else 
        {
            printf("Error opening file \nEXIT!");
     exit(0);
        }
Segmentation. strcmp [C]
===

I have a file with format: [name][number][amount]
number is taken as a string. and im using it in a strcmp.
Problem is that i get a segmentation fault. I know that on most cases when strcmp signs segmentation fault it means that one of the parameters is null or cant find its "end" ('\0').
I checked with gdb and i cant say if this is the problem.Take a look:

    > (gdb) bt full
    > #0  0x08048729 in lookup (hashtable=0x804b008, hashval=27, 
    >     number=0x804b740 "6900101001") 
    >         list = 0xffffffff
    > #1  0x080487ac in add (hashtable=0x804b008, 
    >     number=0x804b740 "9900101001", name=0x804b730 "Smithpolow",
    > time=6943) 
    >         new_elem = 0xffffffff
    >         hashval = 27
    > #2  0x08048b25 in main (argc=1, argv=0xbffff4b4) 
    >         number = 0x804b740 "9900101001"
    >         name = 0x804b730 "Smithpolow"
    >         time = 6943
    >         i = 2


Code:

    clientsList *lookup_on_Clients(clientsHashTable *hashtable,int hashval,char number[10])
    {
     printf("NUMBER:%s\n",number);
     clientsList *list=hashtable[hashval].head;
     for(list; list!=NULL; list=list->next){
       if (strcmp(number,list->name)==0)   //SEGMENTATION!
        return list;
      
     }
     return NULL;
    }



and the main:

    FILE * File2;
        if ( ( File2=fopen(" File.txt","r")) !=NULL ) 
        { // File.txt format:  [name number time] e.g lountemis 6900254565 700651
            int li = 0;
            char *lin = (char *) malloc(MAX_LINE * sizeof(char));
      
            while(fgets(lin, MAX_LINE, clientFile2) != NULL)
            {
                token = my_linetok(lin, " ");
                if(token != NULL)
                {
      char* number ;
      char* name;
      int time;
      int i;
                    for(i = 0; token[i] != NULL; i++)
                    {
       name=strdup(token[0]);
       number=strdup(token[1]);
       time=atoi(token[2]);
        
       if (i==2)
       { int insertDone=0;
             insertDone =add(my_hash_table,number,name,time);   
        
       } 
      }
      free(name);
      free(token);
                }
                else 
         {
                    printf("Error reading line %s\n", lin);
                    exit(1);   
                }
            }
     
        } 
        else 
        {
            printf("Error opening file \nEXIT!");
     exit(0);
        }