I am trying to use strtok to separate a string by a comma. The line looks like this:

```
A:K149, A:N171, A:T172

```

I am using the following code. 

```
 pch=strtok(line,",");
 printf("%s\n",pch);

        while(pch!=NULL){
        pch=strtok(NULL,", ");        
            printf("%s\n",pch);
        }  

```

But what gets printed is:

```
A:K149
A:N171
A:T172

(null)

```

How do I get rid of the extra line and the (null) at the end?