Changeset 1369 for pjproject


Ignore:
Timestamp:
Jun 15, 2007 4:15:16 AM (17 years ago)
Author:
bennylp
Message:

Handle negative number in my_atoi() in pjsua_app.c (thanks Scott M Ober)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r1336 r1369  
    310310{ 
    311311    pj_str_t s; 
    312     return pj_strtoul(pj_cstr(&s, cs)); 
     312 
     313    pj_cstr(&s, cs); 
     314    if (cs[0] == '-') { 
     315        s.ptr++, s.slen--; 
     316        return 0 - (int)pj_strtoul(&s); 
     317    } else if (cs[0] == '+') { 
     318        s.ptr++, s.slen--; 
     319        return pj_strtoul(&s); 
     320    } else { 
     321        return pj_strtoul(&s); 
     322    } 
    313323} 
    314324 
Note: See TracChangeset for help on using the changeset viewer.