Changeset 566987b0 in mainline
- Timestamp:
- 2008-07-30T16:58:14Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2a513972
- Parents:
- 29f8f8e
- Location:
- uspace/lib/libc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/string.c
r29f8f8e r566987b0 39 39 #include <align.h> 40 40 #include <sys/types.h> 41 41 #include <malloc.h> 42 42 43 43 /* Dummy implementation of mem/ functions */ … … 354 354 } 355 355 356 char * strdup(const char *s1) 357 { 358 size_t len = strlen(s1) + 1; 359 void *ret = malloc(len); 360 361 if (ret == NULL) 362 return (char *) NULL; 363 364 return (char *) memcpy(ret, s1, len); 365 } 366 356 367 /** @} 357 368 */ -
uspace/lib/libc/include/string.h
r29f8f8e r566987b0 56 56 extern size_t strlen(const char *); 57 57 58 extern char *strdup(const char *); 59 58 60 extern char *strchr(const char *, int); 59 61 extern char *strrchr(const char *, int);
Note:
See TracChangeset
for help on using the changeset viewer.