autodriver/autodriver.c
static int parse_uint(char *str, unsigned *num) {
    char *end;

    errno = 0;
    unsigned long result = strtoul(str, &end, 0);

    // Check for a parse error
    if (errno != 0 || *end != '\0') {
        return -1;
    }

    // Check for overflow
    if (result > UINT_MAX) {
        return -1;
    }

    *num = (unsigned) result;
    return 0;
}
/**
 * @brief Parses a string into an unsigned integer.
 *
 * The string must be _just_ an integer. On parse failure, num is not modified.
 *
 * @arg str String to parse
 * @arg num Pointer to store result in
 *
 * @return 0 on success, -1 on parse failure
 */
@brief Parses a string into an unsigned integer.
The string must be _just_ an integer. On parse failure, num is not modified.

@arg str String to parse
@arg num Pointer to store result in

@return 0 on success, -1 on parse failure
@brief Parses a string into an unsigned integer . The string must be _just_ an integer . On parse failure num is not modified . @arg str String to parse @arg num Pointer to store result in @return 0 on success - 1 on parse failure
static int parse_uint(char *str, unsigned *num) {
    char *end;
    errno = 0;
    unsigned long result = strtoul(str, &end, 0);
    if (errno != 0 || *end != '\0') {
        return -1;
    }
    if (result > UINT_MAX) {
        return -1;
    }
    *num = (unsigned) result;
    return 0;
}
static int parse_uint ( char * str , unsigned * num ) { char * end ; errno = 0 ; unsigned long result = strtoul ( str , & end , 0 ) ; if ( errno != 0 || * end != ' \0 ' ) { return -1 ; } if ( result > UINT_MAX ) { return -1 ; } * num = ( unsigned ) result ; return 0 ; }
@brief Parses a string into an unsigned integer.
@brief Parses a string into an unsigned integer .
// Check for a parse error // Check for overflow