mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-19 19:23:24 +02:00
util/nvmutil: better SSIZE_MAX define
the old one assumes that ssize_t is signed size_t, which let's face it, is always true in practise, but not actually guaranteed! so now i'm using one that's even more pedantic. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -285,12 +285,8 @@ static const char *mac_str;
|
|||||||
static const char *fname;
|
static const char *fname;
|
||||||
static const char *argv0;
|
static const char *argv0;
|
||||||
|
|
||||||
#ifndef SIZE_MAX
|
|
||||||
#define SIZE_MAX ((size_t)-1)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SSIZE_MAX
|
#ifndef SSIZE_MAX
|
||||||
#define SSIZE_MAX ((ssize_t)(SIZE_MAX >> 1))
|
#define SSIZE_MAX ((ssize_t)(~((size_t)1 << (sizeof(ssize_t)*CHAR_BIT-1))))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user