Fix (void*) maths.

Doing void* pointer math is undefined behaviour.
This commit is contained in:
Rab H. Sonmai 2016-10-15 19:36:32 +02:00 committed by GitHub
parent 1e807ad91d
commit d240984c07

View File

@ -27,7 +27,7 @@ static char* getStringFromRegmatch(char* source,size_t so,size_t eo)
word[0] = '\0';
}else{
word = malloc(sizeof(char) * (wordlength + 1));
memcpy((void*)word,(void*)source + so,wordlength);//copy string
memcpy((void*)word,(void*)(source + so),wordlength);//copy string
word[sizeof(char) * (wordlength)] = '\0';
}
return word;