mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-19 00:03:45 +02:00
nvmutil: extremely defensive CHAR_BIT test
this program needs bits to be 8 some obscure systems set it to something else Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -154,6 +154,13 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
unsigned long *i;
|
unsigned long *i;
|
||||||
|
|
||||||
|
#ifndef CHAR_BIT
|
||||||
|
err(ECANCELED, "Unknown char size");
|
||||||
|
#else
|
||||||
|
if (CHAR_BIT != 8)
|
||||||
|
err(EINVAL, "Unsupported char size");
|
||||||
|
#endif
|
||||||
|
|
||||||
nv = new_xstate();
|
nv = new_xstate();
|
||||||
if (nv == NULL)
|
if (nv == NULL)
|
||||||
err(errno, NULL);
|
err(errno, NULL);
|
||||||
@@ -165,9 +172,6 @@ main(int argc, char *argv[])
|
|||||||
if (nv->f.buf == NULL)
|
if (nv->f.buf == NULL)
|
||||||
err(EINVAL, "Work buffer not initialised");
|
err(EINVAL, "Work buffer not initialised");
|
||||||
|
|
||||||
if (CHAR_BIT != 8)
|
|
||||||
err(EINVAL, "Unsupported char size");
|
|
||||||
|
|
||||||
f = &nv->f;
|
f = &nv->f;
|
||||||
|
|
||||||
f->fname = argv[1];
|
f->fname = argv[1];
|
||||||
|
|||||||
Reference in New Issue
Block a user