diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2017-02-01 22:10:45 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-07-14 13:47:31 +0100 |
commit | b41c851312876dbf146fb674265b86c72ed611ab (patch) | |
tree | 039df84c471a7271495e7c94a095aa14cd8614c2 /scripts/basic | |
parent | 213b279baaae27a4285eb354f11e3c3b1986d129 (diff) | |
download | busybox-w32-b41c851312876dbf146fb674265b86c72ed611ab.tar.gz busybox-w32-b41c851312876dbf146fb674265b86c72ed611ab.tar.bz2 busybox-w32-b41c851312876dbf146fb674265b86c72ed611ab.zip |
fixdep: fix assumption that `long` is as large as `void *`
It is not. At least not in general. And in particular not on 64-bit
Windows, where sizeof(long) == 4.
What the code wanted to use is actually called intptr_t.
Note: `intptr_t` is a C99 feature.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'scripts/basic')
-rw-r--r-- | scripts/basic/fixdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index d3aa4e390..9f461a65b 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -353,7 +353,7 @@ void do_config_file(char *filename) | |||
353 | return; | 353 | return; |
354 | } | 354 | } |
355 | map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); | 355 | map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); |
356 | if ((long) map == -1) { | 356 | if ((intptr_t) map == -1) { |
357 | perror("fixdep: mmap"); | 357 | perror("fixdep: mmap"); |
358 | close(fd); | 358 | close(fd); |
359 | return; | 359 | return; |
@@ -428,7 +428,7 @@ void print_deps(void) | |||
428 | return; | 428 | return; |
429 | } | 429 | } |
430 | map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); | 430 | map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); |
431 | if ((long) map == -1) { | 431 | if ((intptr_t) map == -1) { |
432 | perror("fixdep: mmap"); | 432 | perror("fixdep: mmap"); |
433 | close(fd); | 433 | close(fd); |
434 | return; | 434 | return; |