# HG changeset patch # User Wohlstand # Date 1574000808 -10800 # Sun Nov 17 17:26:48 2019 +0300 # Node ID c44c318c90cb989f0fbf618ae6576a1c8cd18774 # Parent e134ad0641263b362b6432fac5fd014f7755eb66 OGG Vorbis: Replace str_to_int64 with `SDL_strtoull(x, NULL, 10)` This workaround is no more needed as SDL_strtoull with 10 base works as needed. The SDL_strtoull with 0 will not work. https://bugzilla.libsdl.org/show_bug.cgi?id=4855#c8 diff -r e134ad064126 -r c44c318c90cb music_ogg.c --- a/music_ogg.c Tue Nov 12 12:30:59 2019 +0300 +++ b/music_ogg.c Sun Nov 17 17:26:48 2019 +0300 @@ -223,25 +223,6 @@ return 0; } -/* Convert string into integer with clean-up from junk and leading zeroes */ -static ogg_int64_t str_to_int64(char *param) -{ - char *front = param; - char *back; - - /* Find digit between of 1 and 9 at begin */ - while (*front != '\0' && (*front < '1' || *front > '9')) { - front++; - } - /* Find any non-digit character or NULL */ - back = front; - while (*back != '\0' && (*back >= '0' && *back <= '9')) { - back++; - } - *back = '\0'; - return (ogg_int64_t)SDL_strtoull(front, NULL, 0); -} - /* Parse time string of the form HH:MM:SS.mmm and return equivalent sample * position */ static ogg_int64_t parse_time(char *time, long samplerate_hz) @@ -252,7 +233,7 @@ /* Time is directly expressed as a sample position */ if (SDL_strchr(time, ':') == NULL) { - return str_to_int64(time); + return (ogg_int64_t)SDL_strtoull(time, NULL, 10); } result = 0; @@ -336,7 +317,7 @@ if (SDL_strcasecmp(argument, "LOOPSTART") == 0) music->loop_start = parse_time(value, rate); else if (SDL_strcasecmp(argument, "LOOPLENGTH") == 0) { - music->loop_len = str_to_int64(value); + music->loop_len = (ogg_int64_t)SDL_strtoull(value, NULL, 10); isLoopLength = 1; } else if (SDL_strcasecmp(argument, "LOOPEND") == 0) { isLoopLength = 0;