mirror of
https://github.com/thepigeongenerator/tetris_clone.git
synced 2025-12-17 05:55:46 +01:00
fix: invalid memory access due to dereferencing after indexing
This commit is contained in:
@@ -59,7 +59,7 @@ static inline int str_put(char* restrict* restrict dest, size_t dest_len, char c
|
|||||||
|
|
||||||
// copy the missing data to the end of the destination
|
// copy the missing data to the end of the destination
|
||||||
memcpy(*dest + dest_len, src + dest_len, src_len - dest_len);
|
memcpy(*dest + dest_len, src + dest_len, src_len - dest_len);
|
||||||
*dest[src_len] = '\0'; // null-terminate the destination
|
(*dest)[src_len] = '\0'; // null-terminate the destination
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user