```
/*Input string argument can be up to 3 integer numbers, 
  separated by spaces.  A wild card value, represented by a * 
  character can replace any one of the integer numbers.*/

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>

void parse(char *data);

int program = 0, version = 0, process = 0;

unsigned char flags = 0;

#define GOT_PROG 0x01

#define GOT_VERS 0x02

#define GOT_PROC 0x04

int main()

{
    char data[] = " * 10 7 ";
    parse(data);
    system("PAUSE");
    return 0;
}

void parse(char *data)
{

    char *tmp = NULL;
    /* advance past whitespace */
    while(isspace((int)*data)) data++;
    if(*data != '*')
    {
        program = strtoul(data,&tmp,0);
        flags|=GOT_PROG;
        printf("%d 11\n",program );
    }

    if(*tmp == '\0') return;
    data=++tmp;

    if(*data != '*')
    {
        version = strtoul(data,&tmp,0);
        flags|=GOT_VERS;
        printf("%d  22\n",version);
    }
    else
    {
        tmp++;
    }

    if(*tmp == '\0') return;
    data=++tmp;

    if(*data != '*')
    {
        process = strtoul(data,&tmp,0);
        flags|=GOT_PROC;
        printf("%d  33\n",process);
    }
}

```

When my inputs are 3 integers it runs fine.
When my Inputs are two ints and one `*` it runs fine except when I replace 1st integer with an `*`, not sure where am I going wrong!! Any suggestions?