Skip to content

Commit

Permalink
Use uintptr_t in fts for pointer alignment
Browse files Browse the repository at this point in the history
The code assumed unsigned long can represent pointers.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
  • Loading branch information
nsz-arm committed Nov 1, 2022
1 parent f66780b commit f4973d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion io/fts.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#include <dirent.h>
#include <errno.h>
#include <fts.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Expand All @@ -67,7 +68,7 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94";
#endif
/* Align P to that size. */
#ifndef ALIGN
#define ALIGN(p) (((unsigned long int) (p) + ALIGNBYTES) & ~ALIGNBYTES)
#define ALIGN(p) (((uintptr_t) (p) + ALIGNBYTES) & ~ALIGNBYTES)
#endif


Expand Down

0 comments on commit f4973d3

Please sign in to comment.