Ignore:
Timestamp:
05/08/11 23:08:36 (9 years ago)
Author:
Admin
Message:

Replace strtok() with the reentrant and threadsafe function strtok_r()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oscam-http-helpers.c

    r5200 r5201  
    334334    char *pch = authstring + 22;
    335335    char *pch2;
    336     char *save=NULL;
    337 
    338     pch = strtok_r (pch,",",&save);
    339     while (pch != NULL){
     336    char *saveptr1=NULL;
     337
     338    for(pch = strtok_r (pch, ",", &saveptr1); pch; pch = strtok_r (NULL, ",", &saveptr1)){
    340339        pch2 = pch;
    341340      while(pch2[0] == ' ' && pch2[0] != '\0') ++pch2;
     
    352351      } else if (strncmp(pch2, "username", 8) == 0){
    353352        username=parse_auth_value(pch2);
    354       }
    355       pch = strtok_r (NULL, ",",&save);
     353      }   
    356354    }
    357355
Note: See TracChangeset for help on using the changeset viewer.