Changeset 102a729 in mainline
- Timestamp:
- 2011-07-20T19:43:22Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4cf8ca6
- Parents:
- 087c8798
- Location:
- uspace/lib/posix
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/stdlib.c
r087c8798 r102a729 40 40 41 41 #include "errno.h" 42 #include "limits.h" 42 43 43 44 #include "libc/sort.h" … … 138 139 { 139 140 int (*compare)(const void *, const void *) = userdata; 140 return compare(elem1, elem2); 141 int ret = compare(elem1, elem2); 142 143 /* Native qsort internals expect this. */ 144 if (ret < 0) { 145 return -1; 146 } else if (ret > 0) { 147 return 1; 148 } else { 149 return 0; 150 } 141 151 } 142 152 … … 353 363 void *posix_realloc(void *ptr, size_t size) 354 364 { 355 return realloc(ptr, size); 365 if (ptr != NULL && size == 0) { 366 /* Native realloc does not handle this special case. */ 367 free(ptr); 368 return NULL; 369 } else { 370 return realloc(ptr, size); 371 } 356 372 } 357 373 -
uspace/lib/posix/stdlib/strtol.c
r087c8798 r102a729 190 190 /* overflow */ 191 191 errno = ERANGE; 192 result = max_value;192 result = real_max_value; 193 193 break; 194 194 } -
uspace/lib/posix/stdlib/strtold.c
r087c8798 r102a729 547 547 548 548 if (endptr != NULL) { 549 *endptr = (char *) &nptr[i + 3];550 } 551 errno = E RANGE;552 return negative ? -0.0l : +0.0l;549 *endptr = (char *) nptr; 550 } 551 errno = EINVAL; 552 return 0; 553 553 } 554 554
Note:
See TracChangeset
for help on using the changeset viewer.