Changeset 752:9e9840ccf059 in freeDiameter for libfdproto/ostr.c
- Timestamp:
- Sep 24, 2011, 4:45:14 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdproto/ostr.c
r743 r752 45 45 os0_t r; 46 46 CHECK_MALLOC_DO( r = malloc(l+1), return NULL ); 47 memcpy(r, s, l); /* this might be faster than a strcpy or strdup because it can work with 32 or 64b blocks */ 47 if (l) 48 memcpy(r, s, l); /* this might be faster than a strcpy or strdup because it can work with 32 or 64b blocks */ 48 49 r[l] = '\0'; 49 50 return r; … … 58 59 if (os1sz > os2sz) 59 60 return 1; 60 return memcmp(os1, os2, os1sz);61 return os1sz ? memcmp(os1, os2, os1sz) : 0; 61 62 } 62 63
Note: See TracChangeset
for help on using the changeset viewer.