quick sscanf format issue tails in c
===

All I hope someone can help me with this code it works fine and when i search for the PRD section for instance will return 224652 which is should however I need the tail section as well so for example 224652-001. How to fix my sscanf part to do this I tried all night.

 

    #include <stdio.h>  
        #include <string.h>  
        #include <windows.h>  
         
        int main () 

 
    {  
        // in my application this comes from the handle and readfile 
        char buffer[255]="YEARMADE-12345.TRY-12453.PRD-224652-001.SERVCODE-12355" ;     
        // 
        int i;  
        int codes[256];   
        char *pos = buffer;   
        size_t current = 0;   
        //   
        while ((pos=strstr(pos, "PRD")) != NULL) {   
            if (sscanf(pos, "PRD - %d -", codes+current))   
                ++current;   
            pos += 4;   
        }   
     
        for (i=0; i<current; i++)  
            printf("%d\n", codes[i]);  
        system("pause"); 
        return 0;  
    }  

Thanks