Change mem_has_null return type to bool

This commit is contained in:
Robert Müller 2023-02-04 00:36:26 +01:00
parent cb6de6a384
commit d4809fa9a8
2 changed files with 5 additions and 6 deletions

View file

@ -228,7 +228,7 @@ int mem_comp(const void *a, const void *b, int size)
return memcmp(a, b, size); return memcmp(a, b, size);
} }
int mem_has_null(const void *block, unsigned size) bool mem_has_null(const void *block, unsigned size)
{ {
const unsigned char *bytes = (const unsigned char *)block; const unsigned char *bytes = (const unsigned char *)block;
unsigned i; unsigned i;
@ -236,10 +236,10 @@ int mem_has_null(const void *block, unsigned size)
{ {
if(bytes[i] == 0) if(bytes[i] == 0)
{ {
return 1; return true;
} }
} }
return 0; return false;
} }
IOHANDLE io_open_impl(const char *filename, int flags) IOHANDLE io_open_impl(const char *filename, int flags)

View file

@ -181,10 +181,9 @@ int mem_comp(const void *a, const void *b, int size);
* @param block Pointer to the block to check for nulls. * @param block Pointer to the block to check for nulls.
* @param size Size of the block. * @param size Size of the block.
* *
* @return 1 - The block has a null byte. * @return true if the block has a null byte, false otherwise.
* @return 0 - The block does not have a null byte.
*/ */
int mem_has_null(const void *block, unsigned size); bool mem_has_null(const void *block, unsigned size);
/** /**
* @defgroup File-IO * @defgroup File-IO