Changeset 730:e21d79595045 in freeDiameter for libfdproto/ostr.c
- Timestamp:
- Feb 24, 2011, 5:19:42 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdproto/ostr.c
r719 r730 41 41 #endif /* !defined(DIAMID_IDNA_IGNORE) && !defined(DIAMID_IDNA_REJECT) */ 42 42 43 /* Similar to strdup with (must beverified) os0_t */43 /* Similar to strdup with (must have been verified) os0_t */ 44 44 os0_t os0dup_int(os0_t s, size_t l) { 45 45 os0_t r; 46 CHECK_MALLOC_DO( r = calloc(l+1,1), return NULL );46 CHECK_MALLOC_DO( r = malloc(l+1), return NULL ); 47 47 memcpy(r, s, l); /* this might be faster than a strcpy or strdup because it can work with 32 or 64b blocks */ 48 r[l] = '\0'; 48 49 return r; 49 50 }
Note: See TracChangeset
for help on using the changeset viewer.