src/reader/ssp/Util.c
static int xml_parse_int(const xmlChar * buffer, int * dest) {
    int value = 0;
    int ret_val = 0;
    int num = 0;

    // skip over leading whitespace
    while ((isspace(buffer[num]) && buffer[num] != '\0')) {
        num += 1;
    }

    ret_val = sscanf(buffer + num, "%d", &value);
    if (ret_val == 1) {
        *dest = value;
    } else {
        return -1;
    }

    // skip over (non-whitespace) value
    while (!(isspace(buffer[num]) || buffer[num] == '\0')) {
        num += 1;
    }

    return num;
}
/**
 * Parses an int value from buffer into dest.
 *
 * @return The number of read characters from buffer or -1 if no int
 * could be parsed.
 */
Parses an int value from buffer into dest.
@return The number of read characters from buffer or -1 if no int
could be parsed.
Parses an int value from buffer into dest . @return The number of read characters from buffer or - 1 if no int could be parsed .
static int xml_parse_int(const xmlChar * buffer, int * dest) {
    int value = 0;
    int ret_val = 0;
    int num = 0;
    while ((isspace(buffer[num]) && buffer[num] != '\0')) {
        num += 1;
    }
    ret_val = sscanf(buffer + num, "%d", &value);
    if (ret_val == 1) {
        *dest = value;
    } else {
        return -1;
    }
    while (!(isspace(buffer[num]) || buffer[num] == '\0')) {
        num += 1;
    }
    return num;
}
static int xml_parse_int ( const xmlChar * buffer , int * dest ) { int value = 0 ; int ret_val = 0 ; int num = 0 ; while ( ( isspace ( buffer [ num ] ) && buffer [ num ] != ' \0 ' ) ) { num += 1 ; } ret_val = sscanf ( buffer + num , " " , & value ) ; if ( ret_val == 1 ) { * dest = value ; } else { return -1 ; } while ( ! ( isspace ( buffer [ num ] ) || buffer [ num ] == ' \0 ' ) ) { num += 1 ; } return num ; }
Parses an int value from buffer into dest.
Parses an int value from buffer into dest .
// skip over leading whitespace // skip over (non-whitespace) value