Skip to content
Snippets Groups Projects
Commit b2338968 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Merge branch 'alignment-test-nullcheck' into 'master'

Don't accept null pointer in tests when requesting aligned memory

See merge request !272
parents 39346f5c cf9c2ed0
No related branches found
No related tags found
1 merge request!272Don't accept null pointer in tests when requesting aligned memory
Pipeline #7565 failed
......@@ -31,7 +31,7 @@ void test_valid_aligned(void *ptr, size_t alignment, int error_val) {
* address. */
uintptr_t ptr_alignment_rem = (uintptr_t)ptr % (uintptr_t)alignment;
if (ptr_alignment_rem == 0) {
if (ptr != NULL && ptr_alignment_rem == 0) {
// Constant output for successful case
printf("pointer: (alignment OK), ");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment