Changeset 849:d7f940afd933 in freeDiameter for libfdproto
- Timestamp:
- Oct 22, 2012, 12:12:13 AM (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdproto/portability.c
r837 r849 46 46 } 47 47 #endif /* HAVE_CLOCK_GETTIME */ 48 49 /* Replacement for strndup for the Mac OS */ 50 #ifndef HAVE_STRNDUP 51 char * strndup (char *str, size_t len) 52 { 53 char * output; 54 size_t outlen = strnlen (str, len); 55 CHECK_MALLOC_DO( output = malloc (outlen + 1), return NULL ); 56 57 output[outlen] = '\0'; 58 memcpy (output, str, outlen); 59 return output; 60 } 61 #endif /* HAVE_STRNDUP */
Note: See TracChangeset
for help on using the changeset viewer.