Browse Source

Replaced manual array copy with memcpy

master
ooxi 12 years ago
parent
commit
029c514ed8
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      test/test-xml.c

+ 2
- 3
test/test-xml.c View File

@@ -77,9 +77,8 @@ static _Bool string_equals(struct xml_string* a, char const* b) {
*/ */
#define SOURCE(source, content) \ #define SOURCE(source, content) \
uint8_t* source = alloca(strlen(content) * sizeof(uint8_t)); \ uint8_t* source = alloca(strlen(content) * sizeof(uint8_t)); \
{ size_t i = 0; for (; i < strlen(content); ++i) { \
source[i] = content[i]; \
} \
{ char const* content_string = content; \
memcpy(source, content_string, strlen(content)); \
} }






Loading…
Cancel
Save