Changes in util.c [34509d5:89f5338]
Legend:
- Unmodified
- Added
- Removed
-
util.c
r34509d5 r89f5338 446 446 void *owl_malloc(size_t size) 447 447 { 448 return( g_malloc(size));448 return(malloc(size)); 449 449 } 450 450 451 451 void owl_free(void *ptr) 452 452 { 453 g_free(ptr);453 free(ptr); 454 454 } 455 455 456 456 char *owl_strdup(const char *s1) 457 457 { 458 return( g_strdup(s1));458 return(strdup(s1)); 459 459 } 460 460 461 461 void *owl_realloc(void *ptr, size_t size) 462 462 { 463 return( g_realloc(ptr, size));463 return(realloc(ptr, size)); 464 464 } 465 465 … … 759 759 char * owl_util_baseclass(char * class) 760 760 { 761 char *ret;762 761 char *start, *end; 763 762 … … 769 768 start = owl_strdup(start); 770 769 end = start + strlen(start) - 1; 771 while( *end == 'd' && *(end-1) == '.') {770 while(end > start && *end == 'd' && *(end-1) == '.') { 772 771 end -= 2; 773 772 } … … 775 774 776 775 return start; 776 } 777 778 char * owl_get_datadir() { 779 char * datadir = getenv("BARNOWL_DATA_DIR"); 780 if(datadir != NULL) 781 return strchr(datadir, '=') + 1; 782 return DATADIR; 777 783 } 778 784 … … 789 795 int numfailed=0; 790 796 791 printf(" BEGIN testing owl_util\n");797 printf("# BEGIN testing owl_util\n"); 792 798 793 799 FAIL_UNLESS("owl_util_substitute 1", … … 812 818 !strcmp("meep foo bar", owl_util_uniq("meep foo", "bar foo meep", "-"))); 813 819 814 if (numfailed) printf("*** WARNING: failures encountered with owl_util\n");815 printf(" END testing owl_util (%d failures)\n", numfailed);820 // if (numfailed) printf("*** WARNING: failures encountered with owl_util\n"); 821 printf("# END testing owl_util (%d failures)\n", numfailed); 816 822 return(numfailed); 817 823 }
Note: See TracChangeset
for help on using the changeset viewer.