Explorar el Código

Replaced manual array copy with memcpy

master
ooxi hace 11 años
padre
commit
029c514ed8
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  1. +2
    -3
      test/test-xml.c

+ 2
- 3
test/test-xml.c Ver fichero

@@ -77,9 +77,8 @@ static _Bool string_equals(struct xml_string* a, char const* b) {
*/
#define SOURCE(source, content) \
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)); \
}




Cargando…
Cancelar
Guardar