openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/glibc/2.29-r0/git/nss/nss_compat/compat-grp.c
static void blacklist_store_name(const char* name, ent_t* ent)
{
    int namelen = strlen(name);
    char* tmp;

    /* first call, setup cache */
    if (ent->blacklist.size == 0)
    {
        ent->blacklist.size = MAX(BLACKLIST_INITIAL_SIZE, 2 * namelen);
        ent->blacklist.data = malloc(ent->blacklist.size);
        if (ent->blacklist.data == NULL)
            return;
        ent->blacklist.data[0] = '|';
        ent->blacklist.data[1] = '\0';
        ent->blacklist.current = 1;
    }
    else
    {
        if (in_blacklist(name, namelen, ent))
            return; /* no duplicates */

        if (ent->blacklist.current + namelen + 1 >= ent->blacklist.size)
        {
            ent->blacklist.size += MAX(BLACKLIST_INCREMENT, 2 * namelen);
            tmp = realloc(ent->blacklist.data, ent->blacklist.size);
            if (tmp == NULL)
            {
                free(ent->blacklist.data);
                ent->blacklist.size = 0;
                return;
            }
            ent->blacklist.data = tmp;
        }
    }

    tmp = stpcpy(ent->blacklist.data + ent->blacklist.current, name);
    *tmp++ = '|';
    *tmp = '\0';
    ent->blacklist.current += namelen + 1;

    return;
}
/* Support routines for remembering -@netgroup and -user entries.
   The names are stored in a single string with `|' as separator. */
Support routines for remembering -@netgroup and -user entries.
The names are stored in a single string with `|' as separator.
Support routines for remembering - @netgroup and - user entries . The names are stored in a single string with ` | ' as separator .
static void blacklist_store_name(const char* name, ent_t* ent)
{
    int namelen = strlen(name);
    char* tmp;
    if (ent->blacklist.size == 0)
    {
        ent->blacklist.size = MAX(BLACKLIST_INITIAL_SIZE, 2 * namelen);
        ent->blacklist.data = malloc(ent->blacklist.size);
        if (ent->blacklist.data == NULL)
            return;
        ent->blacklist.data[0] = '|';
        ent->blacklist.data[1] = '\0';
        ent->blacklist.current = 1;
    }
    else
    {
        if (in_blacklist(name, namelen, ent))
            return; 
        if (ent->blacklist.current + namelen + 1 >= ent->blacklist.size)
        {
            ent->blacklist.size += MAX(BLACKLIST_INCREMENT, 2 * namelen);
            tmp = realloc(ent->blacklist.data, ent->blacklist.size);
            if (tmp == NULL)
            {
                free(ent->blacklist.data);
                ent->blacklist.size = 0;
                return;
            }
            ent->blacklist.data = tmp;
        }
    }
    tmp = stpcpy(ent->blacklist.data + ent->blacklist.current, name);
    *tmp++ = '|';
    *tmp = '\0';
    ent->blacklist.current += namelen + 1;
    return;
}
static void blacklist_store_name ( const char * name , ent_t * ent ) { int namelen = strlen ( name ) ; char * tmp ; if ( ent -> blacklist . size == 0 ) { ent -> blacklist . size = MAX ( BLACKLIST_INITIAL_SIZE , 2 * namelen ) ; ent -> blacklist . data = malloc ( ent -> blacklist . size ) ; if ( ent -> blacklist . data == NULL ) return ; ent -> blacklist . data [ 0 ] = ' ' ; ent -> blacklist . data [ 1 ] = ' \0 ' ; ent -> blacklist . current = 1 ; } else { if ( in_blacklist ( name , namelen , ent ) ) return ; if ( ent -> blacklist . current + namelen + 1 >= ent -> blacklist . size ) { ent -> blacklist . size += MAX ( BLACKLIST_INCREMENT , 2 * namelen ) ; tmp = realloc ( ent -> blacklist . data , ent -> blacklist . size ) ; if ( tmp == NULL ) { free ( ent -> blacklist . data ) ; ent -> blacklist . size = 0 ; return ; } ent -> blacklist . data = tmp ; } } tmp = stpcpy ( ent -> blacklist . data + ent -> blacklist . current , name ) ; * tmp ++ = ' ' ; * tmp = ' \0 ' ; ent -> blacklist . current += namelen + 1 ; return ; }
Support routines for remembering -@netgroup and -user entries.
Support routines for remembering - @netgroup and - user entries .
/* first call, setup cache */ /* no duplicates */