Fix debug assert in ioctl to check if int will fit in
unsigned long not be unsigned long Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
This commit is contained in:
parent
6204e10e2e
commit
4e7d59f6bc
@ -91,7 +91,7 @@ int ioctl(int fd, int req, ...)
|
|||||||
/* Get the unsigned long argument.
|
/* Get the unsigned long argument.
|
||||||
*
|
*
|
||||||
* REVISIT: This could be the cause of the crash down the road if the
|
* REVISIT: This could be the cause of the crash down the road if the
|
||||||
* actual size of the argument is anything other than sizeof(unsigned long).
|
* actual size of the argument not sizeof(unsigned long).
|
||||||
* Most small integers will be promoted to 'int'. ARM should pass the
|
* Most small integers will be promoted to 'int'. ARM should pass the
|
||||||
* following test with all three types having sizeof(type) == 4 bytes.
|
* following test with all three types having sizeof(type) == 4 bytes.
|
||||||
* 'float' should also be tested. But 'long long' and 'double' are out of
|
* 'float' should also be tested. But 'long long' and 'double' are out of
|
||||||
@ -102,7 +102,7 @@ int ioctl(int fd, int req, ...)
|
|||||||
* discover cases where something worse happens!
|
* discover cases where something worse happens!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEBUGASSERT(sizeof(int) == sizeof(unsigned long) &&
|
DEBUGASSERT(sizeof(int) <= sizeof(unsigned long) &&
|
||||||
sizeof(FAR void *) == sizeof(unsigned long));
|
sizeof(FAR void *) == sizeof(unsigned long));
|
||||||
|
|
||||||
va_start(ap, req);
|
va_start(ap, req);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user