openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rsyslog/8.1903.0-r0/rsyslog-8.1903.0/runtime/msg.c
static rsRetVal aquireProgramName(smsg_t* const pM)
    {
        int i;
        uchar *pszTag, *pszProgName;
        DEFiRet;

        assert(pM != NULL);
        pszTag = (uchar*)((pM->iLenTAG < CONF_TAG_BUFSIZE) ? pM->TAG.szBuf
                                                           : pM->TAG.pszTAG);
        for (i = 0;
             (i < pM->iLenTAG) && isprint((int)pszTag[i]) &&
             (pszTag[i] != '\0') && (pszTag[i] != ':') && (pszTag[i] != '[') &&
             (bPermitSlashInProgramname || (pszTag[i] != '/'));
             ++i)
            ; /* just search end of PROGNAME */
        if (i < CONF_PROGNAME_BUFSIZE)
        {
            pszProgName = pM->PROGNAME.szBuf;
        }
        else
        {
            CHKmalloc(pM->PROGNAME.ptr = malloc(i + 1));
            pszProgName = pM->PROGNAME.ptr;
        }
        memcpy((char*)pszProgName, (char*)pszTag, i);
        pszProgName[i] = '\0';
        pM->iLenPROGNAME = i;
    finalize_it:
        RETiRet;
    }
/* Parse and set the "programname" for a given MSG object. Programname
     * is a BSD concept, it is the tag without any instance-specific
     * information. Precisely, the programname is terminated by either
     * (whichever occurs first):
     * - end of tag
     * - nonprintable character
     * - ':'
     * - '['
     * - '/'
     * The above definition has been taken from the FreeBSD syslogd sources.
     *
     * The program name is not parsed by default, because it is
     * infrequently-used. IMPORTANT: A locked message object must be provided,
     * else a crash will occur. rgerhards, 2005-10-19
     */
Parse and set the "programname" for a given MSG object. Programname
is a BSD concept, it is the tag without any instance-specific
information.

The program name is not parsed by default, because it is
infrequently-used. IMPORTANT: A locked message object must be provided,
else a crash will occur.
Parse and set the " programname " for a given MSG object . Programname is a BSD concept it is the tag without any instance - specific information . The program name is not parsed by default because it is infrequently - used . IMPORTANT : A locked message object must be provided else a crash will occur .
static rsRetVal aquireProgramName(smsg_t* const pM)
    {
        int i;
        uchar *pszTag, *pszProgName;
        DEFiRet;
        assert(pM != NULL);
        pszTag = (uchar*)((pM->iLenTAG < CONF_TAG_BUFSIZE) ? pM->TAG.szBuf
                                                           : pM->TAG.pszTAG);
        for (i = 0;
             (i < pM->iLenTAG) && isprint((int)pszTag[i]) &&
             (pszTag[i] != '\0') && (pszTag[i] != ':') && (pszTag[i] != '[') &&
             (bPermitSlashInProgramname || (pszTag[i] != '/'));
             ++i)
            ; 
        if (i < CONF_PROGNAME_BUFSIZE)
        {
            pszProgName = pM->PROGNAME.szBuf;
        }
        else
        {
            CHKmalloc(pM->PROGNAME.ptr = malloc(i + 1));
            pszProgName = pM->PROGNAME.ptr;
        }
        memcpy((char*)pszProgName, (char*)pszTag, i);
        pszProgName[i] = '\0';
        pM->iLenPROGNAME = i;
    finalize_it:
        RETiRet;
    }
static rsRetVal aquireProgramName ( smsg_t * const pM ) { int i ; uchar * pszTag , * pszProgName ; DEFiRet ; assert ( pM != NULL ) ; pszTag = ( uchar * ) ( ( pM -> iLenTAG < CONF_TAG_BUFSIZE ) ? pM -> TAG . szBuf : pM -> TAG . pszTAG ) ; for ( i = 0 ; ( i < pM -> iLenTAG ) && isprint ( ( int ) pszTag [ i ] ) && ( pszTag [ i ] != ' \0 ' ) && ( pszTag [ i ] != ' ' ) && ( pszTag [ i ] != ' ' ) && ( bPermitSlashInProgramname || ( pszTag [ i ] != ' ' ) ) ; ++ i ) ; if ( i < CONF_PROGNAME_BUFSIZE ) { pszProgName = pM -> PROGNAME . szBuf ; } else { CHKmalloc ( pM -> PROGNAME . ptr = malloc ( i + 1 ) ) ; pszProgName = pM -> PROGNAME . ptr ; } memcpy ( ( char * ) pszProgName , ( char * ) pszTag , i ) ; pszProgName [ i ] = ' \0 ' ; pM -> iLenPROGNAME = i ; finalize_it : RETiRet ; }
Parse and set the "programname" for a given MSG object.
Parse and set the " programname " for a given MSG object .
/* just search end of PROGNAME */