Ignore:
Timestamp:
Nov 17, 2017 4:07:43 AM (6 years ago)
Author:
ming
Message:

Re #2063: Add more doc in other parts of the library

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/cli.c

    r4825 r5697  
    695695            PJ_USE_EXCEPTION; 
    696696 
     697            /* The buffer passed to the scanner is not NULL terminated, 
     698             * but should be safe. See ticket #2063. 
     699             */ 
    697700            pj_scan_init(&scanner, attr->value.ptr, attr->value.slen, 
    698701                         PJ_SCAN_AUTOSKIP_WS, &on_syntax_error); 
     
    723726            } 
    724727            PJ_END; 
    725              
     728 
     729            pj_scan_fini(&scanner); 
     730 
    726731        } else if (!pj_stricmp2(&attr->name, "desc")) { 
    727732            pj_strdup(cli->pool, &cmd->desc, &attr->value); 
     
    861866    pj_cli_exec_info_default(info); 
    862867 
    863     /* Set the parse mode based on the latest char. */ 
     868    /* Set the parse mode based on the latest char. 
     869     * And NULL terminate the buffer for the scanner. 
     870     */ 
    864871    len = pj_ansi_strlen(cmdline); 
    865872    if (len > 0 && ((cmdline[len - 1] == '\r')||(cmdline[len - 1] == '\n'))) { 
     
    931938        } 
    932939        PJ_END; 
     940         
     941        pj_scan_fini(&scanner); 
    933942    }  
    934943     
Note: See TracChangeset for help on using the changeset viewer.