The `PJ_TRUE` argument to `pj_scan_advance_n` means "after advancing, skip any whitespace you find as well".  I think it was designed specifically for this kind of purpose.

    /** 
    * Advance the scanner N characters, and skip whitespace
    * if necessary.
    *
    * @param scanner   The scanner.
    * @param N	    Number of characters to skip.
    * @param skip	    Flag to specify whether whitespace should be skipped
    *		    after skipping the characters.
    */