i want to get line from a txt file with the function prototype

> 
> int getLine(FILE\* ptr,char\* buffer);
> 
> 
> 

but i have a stack problem... 

```
int getLine(FILE* ptr,char* buffer){
int c;
while ( c = getc(ptr) != EOF && c != '\n'){
    *buffer++ = c;
    }
*buffer = '\0';
return 1;
}

```

Segmentation fault (core dumped)