University of Southern CaliforniaUSC
USC ICT TwitterUSC ICT FacebookUSC ICT YouTube

ParserBVH | General SmartBody Discussion | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
ParserBVH
August 14, 2016
1:26 am
Avatar
Member
Members
Forum Posts: 16
Member Since:
January 18, 2016
sp_UserOfflineSmall Offline

Hello

Here is a small bug crashing bvh reader randomly

while(!file.eof() && file.good())
{
    file.getline(line, 8192, '
');
    // remove any trailing
    if (line[strlen(line) - 1] == '
')
        line[strlen(line) - 1] = '\0';
    if (strlen(line) == 0) // ignore blank lines
        continue;

Note the last char is checked for zero-length string as well. The fix is

while(!file.eof() && file.good())
{
    file.getline(line, 8192, '
');
    size_t sLen = strlen(line);
                
    // remove any trailing
    while (sLen && (line[sLen - 1] == '
'))
        line[--sLen] = '\0';
                
    // ignore blank lines
    if (!sLen)
        continue;

Thx

August 16, 2016
10:19 am
Avatar
Admin
Forum Posts: 983
Member Since:
December 1, 2011
sp_UserOfflineSmall Offline

Thanks. added to r6463.

Ari

Forum Timezone: America/Los_Angeles

Top Posters:

jwwalker: 80

jyambao: 52

rbaral: 47

adiaz: 30

WargnierP: 29

lucky7456969: 28

mbarros: 28

avida.matt: 26

JonathanW: 24

laguerre: 23

Member Stats:

Guest Posters: 69

Members: 122101

Moderators: 3

Admins: 4

Forum Stats:

Groups: 1

Forums: 5

Topics: 531

Posts: 2495