Changeset 4860 for trunk/oscam-http-helpers.c
- Timestamp:
- 03/27/11 23:11:57 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-http-helpers.c
r4848 r4860 635 635 636 636 char *value; 637 if(seconds <= 0) 638 return "00:00:00"; 639 637 640 if(!cs_malloc(&value, 16 * sizeof(char), -1)) 638 641 return "00:00:00"; 639 642 640 if(!seconds)641 return "00:00:00";642 643 643 int secs = 0, fullmins = 0, mins = 0, fullhours = 0, hours = 0, days = 0; 644 644 645 if(seconds > 0) { 646 secs = seconds % 60; 647 if (seconds > 60) { 648 fullmins = seconds / 60; 649 mins = fullmins % 60; 650 if(fullmins > 60) { 651 fullhours = fullmins / 60; 652 hours = fullhours % 24; 653 days = fullhours / 24; 654 } 655 } 656 } else { 657 return "00:00:00"; 645 secs = seconds % 60; 646 if (seconds > 60) { 647 fullmins = seconds / 60; 648 mins = fullmins % 60; 649 if(fullmins > 60) { 650 fullhours = fullmins / 60; 651 hours = fullhours % 24; 652 days = fullhours / 24; 653 } 658 654 } 659 655
Note:
See TracChangeset
for help on using the changeset viewer.