Changeset a18a8b9 in mainline
- Timestamp:
- 2015-04-23T23:53:49Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8d1f92f
- Parents:
- 055a68a
- Location:
- uspace/lib/c
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/Makefile
r055a68a ra18a8b9 171 171 TEST_SOURCES = \ 172 172 test/main.c \ 173 test/sprintf.c 173 test/sprintf.c \ 174 test/str.c 174 175 175 176 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/c/generic/str.c
r055a68a ra18a8b9 534 534 535 535 if (c1 == 0 || c2 == 0) 536 break; 536 break; 537 537 } 538 538 … … 588 588 break; 589 589 590 ++len; 590 ++len; 591 591 } 592 592 … … 1058 1058 memmove(str, &str[pos], str_sz - pos); 1059 1059 pos = str_sz - pos; 1060 str[ str_sz -pos] = '\0';1060 str[pos] = '\0'; 1061 1061 } 1062 1062 } … … 1151 1151 } 1152 1152 1153 /** Convert string to a number. 1153 /** Convert string to a number. 1154 1154 * Core of strtol and strtoul functions. 1155 1155 * … … 1197 1197 str += 2; 1198 1198 } 1199 } 1199 } 1200 1200 } 1201 1201 … … 1236 1236 *endptr = (char *) str; 1237 1237 1238 if (nptr == str) { 1238 if (nptr == str) { 1239 1239 /*FIXME: errno = EINVAL*/ 1240 1240 return 0; … … 1267 1267 if ((sgn) && (number == (unsigned long) (LONG_MAX) + 1)) { 1268 1268 /* FIXME: set 0 to errno */ 1269 return number; 1269 return number; 1270 1270 } 1271 1271 /* FIXME: set ERANGE to errno */ 1272 return (sgn ? LONG_MIN : LONG_MAX); 1272 return (sgn ? LONG_MIN : LONG_MAX); 1273 1273 } 1274 1274 -
uspace/lib/c/test/main.c
r055a68a ra18a8b9 33 33 34 34 PCUT_IMPORT(sprintf); 35 PCUT_IMPORT(str); 35 36 36 37 PCUT_MAIN()
Note:
See TracChangeset
for help on using the changeset viewer.