ObjFW  Check-in [33676cd3a9]

Overview
Comment:of_strdup: Add explicit cast for C++ compatibility
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 33676cd3a9ceb0d33d1be94bdba6494330e00724be3e4d230a688e6d8d7dd7fd
User & Date: js on 2014-02-21 01:03:10
Original User & Date: js on 2014-02-21 01:03:11
Other Links: manifest | tags
Context
2014-02-21
01:03
objfw-compile: Allow -m* check-in: ab64692609 user: js tags: trunk
01:03
of_strdup: Add explicit cast for C++ compatibility check-in: 33676cd3a9 user: js tags: trunk
2014-02-20
22:30
Only use LIBOBJFW_DEP after including buildsys.mk check-in: 314d4930d3 user: js tags: trunk
Changes

Modified src/macros.h from [05f8092242] to [0fd9e55556].

417
418
419
420
421
422
423
424
425
426
427
428
429
430

static OF_INLINE char*
of_strdup(const char *string)
{
	char *copy;
	size_t length = strlen(string);

	if ((copy = malloc(length + 1)) == NULL)
		return NULL;

	memcpy(copy, string, length + 1);

	return copy;
}







|






417
418
419
420
421
422
423
424
425
426
427
428
429
430

static OF_INLINE char*
of_strdup(const char *string)
{
	char *copy;
	size_t length = strlen(string);

	if ((copy = (char*)malloc(length + 1)) == NULL)
		return NULL;

	memcpy(copy, string, length + 1);

	return copy;
}